/* bp-stories.css */

/* General Wrapper */
#bp-stories-pro-wrapper {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bp-stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* No H2 here as it's removed from HTML */
}

/* Hide the "Create Story" button as it's now integrated into the carousel */
#bp-stories-create-btn {
    display: none;
}

/* Story Carousel/Feed */
#bp-stories-carousel {
    display: flex;
    gap: 15px; /* Spacing between story circles */
    overflow-x: auto; /* Enable horizontal scrolling */
    padding-bottom: 10px; /* Space for scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ccc #f1f1f1; /* Firefox */
    position: relative; /* For loading messages */
    min-height: 100px; /* To prevent collapse while loading */
    align-items: center; /* Vertically align circles */
}

/* Hide scrollbar for Webkit browsers */
#bp-stories-carousel::-webkit-scrollbar {
    height: 8px;
}
#bp-stories-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
#bp-stories-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
#bp-stories-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.bp-stories-loading, .bp-stories-no-stories {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-style: italic;
}


.bp-story-circle {
    flex-shrink: 0; /* Prevent items from shrinking */
    width: 80px;
    height: 80px;
    border-radius: 50%; /* Default circular */
    border: 2px solid #e0e0e0; /* Default border */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, opacity 0.3s ease;
    margin-bottom: 20px; /* Space for username below */
}

/* Styles for Rectangular shape */
.bp-story-rectangular .bp-story-circle { /* Apply to parent carousel, then children */
    border-radius: 8px; /* Rectangular shape */
    width: 100px; /* Adjust width for rectangular */
    height: 140px; /* Adjust height for rectangular (e.g., 9:16 aspect ratio roughly) */
    padding: 0; /* No padding needed for rectangular if no gradient border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.bp-story-rectangular .bp-story-circle img {
    border-radius: 6px; /* Slightly smaller radius for inner image */
}

/* Overrides for rectangular if it also has new story/gradient */
.bp-story-rectangular .bp-story-circle.has-new-story,
.bp-story-rectangular .bp-story-circle.has-my-stories {
    border-radius: 8px; /* Keep rectangular shape */
    padding: 3px; /* Only if gradient border is applied */
}

.bp-story-rectangular .bp-story-circle img {
    border: 2px solid #fff; /* Inner white border */
}


.bp-story-circle.has-new-story {
    border-color: transparent; /* Hide default border for gradient */
    background: linear-gradient(to right, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    padding: 3px; /* To make room for the wider gradient border */
}
.bp-story-circle.has-my-stories { /* Style for current user's story circle when they have stories */
    border-color: transparent;
    background: linear-gradient(to right, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    padding: 3px;
}

/* Fading for watched stories */
.bp-story-circle.watched {
    opacity: 0.6; /* Make watched stories slightly faded */
}
.bp-story-circle.watched:hover {
    opacity: 0.8; /* Less fade on hover */
}


.bp-story-circle:hover {
    transform: scale(1.05);
}

.bp-story-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Ensure inner image is also round for circular */
    border: 2px solid #fff; /* White border inside gradient or default border */
}

.bp-story-circle .username {
    position: absolute;
    bottom: -18px; /* Adjust as needed to be below the circle */
    font-size: 0.8em;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
    padding: 0 5px;
    box-sizing: border-box;
}

/* Add story specific styles for the plus icon */
.bp-story-circle .add-story-icon {
    position: absolute;
    bottom: 0px; /* Alttan hizalı */
    right: 0px;  /* Sağdan hizalı */
    background-color: #0073aa; /* WordPress blue */
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transform: translate(25%, 25%); /* Sağ alta köşeye taşır */
    z-index: 10; /* Z-index'i artırdım ki en önde olsun */
}
.bp-story-circle .add-story-icon .dashicons {
    color: #fff; /* Ensure dashicon is white */
    font-size: 0.8em; /* Adjust plus size within circle */
}


/* Modal General */
.bp-stories-modal {
    display: none; /* Hidden by default, JS sets to flex */
    position: fixed; /* Stay in place */
    z-index: 100000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    display: flex; /* Use flex for centering */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
    padding: 0; /* Remove padding here, let modal content handle it */
    box-sizing: border-box;
}

.bp-stories-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    box-sizing: border-box;
    /* For viewer modal, this is overridden below */
}

/* Kapatma ikonu */
.bp-stories-close-modal, .bp-stories-close-viewer, .bp-stories-close-report-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    z-index: 10;
}

.bp-stories-close-modal:hover,
.bp-stories-close-modal:focus,
.bp-stories-close-viewer:hover,
.bp-stories-close-viewer:focus,
.bp-stories-close-report-modal:hover,
.bp-stories-close-report-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Story Creation Modal Specifics */
#bp-stories-upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bp-stories-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
}

.bp-stories-upload-label {
    display: block;
    cursor: pointer;
}

.bp-stories-upload-label span.dashicons {
    font-size: 3em;
    color: #999;
}

#bp-stories-preview-container {
    margin-top: 15px;
    position: relative; /* For overlay positioning */
}

#bp-stories-preview-container img,
#bp-stories-preview-container video {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.bp-stories-media-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 50%; /* Adjust size as needed */
    max-height: 50%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1; /* Above background media */
}

.bp-stories-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bp-stories-advanced-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bp-stories-advanced-options button {
    flex-grow: 1;
    min-width: 100px;
}

#bp-stories-music-selection,
#bp-stories-location-selection,
#bp-stories-gif-sticker-selection {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #f5f5f5;
    box-sizing: border-box;
}

#bp-stories-music-dropdown, #bp-stories-location-search, #bp-stories-gif-sticker-search, #bp-stories-story-content, #bp-stories-duration {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Spotify Search Specifics */
#bp-stories-spotify-search {
    margin-bottom: 10px;
}

.bp-stories-search-results {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-top: 10px; /* Adjust if needed */
    background-color: #fff;
}

.bp-stories-spotify-track-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.bp-stories-spotify-track-item:hover {
    background-color: #f5f5f5;
}
.bp-stories-spotify-track-item:last-child {
    border-bottom: none;
}

.bp-stories-spotify-track-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 3px;
}

.bp-stories-spotify-track-item div {
    flex-grow: 1;
}

.bp-stories-spotify-track-item strong {
    display: block;
    font-size: 0.95em;
}
.bp-stories-spotify-track-item span {
    font-size: 0.8em;
    color: #777;
}

.bp-stories-spotify-track-item .bp-stories-play-preview {
    background: none;
    border: none;
    color: #1DB954; /* Spotify green */
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}
.bp-stories-spotify-track-item .bp-stories-play-preview:hover {
    opacity: 0.8;
}

#bp-stories-selected-spotify-music {
    font-size: 0.9em;
    color: #555;
}
#bp-stories-selected-spotify-music a {
    color: #1DB954;
    text-decoration: none;
}
#bp-stories-selected-spotify-music a:hover {
    text-decoration: underline;
}


#bp-stories-gif-sticker-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

#bp-stories-gif-sticker-results img {
    width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    border: 1px solid #eee;
    border-radius: 5px;
}

#bp-stories-upload-message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
}
#bp-stories-upload-message.info { background-color: #e7f7ed; color: #3c763d; }
#bp-stories-upload-message.error { background-color: #f2dede; color: #a94442; }
#bp-stories-upload-message.success { background-color: #dff0d8; color: #3c763d; }


/* Story Viewer Modal Specifics */
#bp-stories-viewer-modal .bp-stories-modal-content {
    background-color: #000; /* Black background for viewer */
    padding: 0;
    max-width: 400px; /* Default desktop width */
    height: 90vh; /* Default desktop height */
    max-height: 700px; /* Max height to avoid super tall stories */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Fullscreen on mobile */
@media (max-width: 768px) {
    #bp-stories-viewer-modal {
        padding: 0 !important; /* Remove padding for full screen */
    }
    #bp-stories-viewer-modal .bp-stories-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important; /* No border radius for full screen */
        margin: 0 !important; /* No margin for full screen */
    }
}


#bp-stories-viewer-inner {
    position: relative;
    width: 100%;
    flex-grow: 1; /* Take up all available space except bottom bar */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
    background-color: #000;
    border-radius: 8px; /* Keep border radius for desktop, mobile will override */
    overflow: hidden;
}

@media (max-width: 768px) {
    #bp-stories-viewer-inner {
        border-radius: 0 !important; /* No border radius for full screen on mobile */
    }
}

.bp-stories-viewer-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255,255,255,0.3);
    z-index: 5;
    display: flex;
    gap: 2px; /* Spacing between individual story progress segments */
}

.bp-stories-viewer-progress-bar .progress-segment {
    flex-grow: 1; /* Each segment takes equal width */
    height: 100%;
    background-color: #fff;
    border-radius: 2px;
    opacity: 0.5; /* Default opacity for unviewed segments */
}
.bp-stories-viewer-progress-bar .progress-segment.active {
    opacity: 1;
}
.bp-stories-viewer-progress-bar .progress-segment .fill {
    height: 100%;
    width: 0%;
    background-color: #fff;
    border-radius: 2px;
}


.bp-stories-viewer-user-info {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 6;
}

.bp-stories-viewer-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #fff;
}

.bp-stories-viewer-user-info span {
    margin-right: 10px;
}
#bp-stories-viewer-location {
    font-size: 0.9em;
    opacity: 0.8;
}

#bp-stories-viewer-content {
    position: absolute;
    top: 70px; /* Below user info */
    left: 15px;
    right: 15px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 6;
    max-height: 50%;
    overflow-y: auto;
    font-size: 1.1em;
}


/* Kapatma ikonu için pozisyon */
.bp-stories-close-viewer {
    position: absolute;
    top: 15px; /* Üstten boşluk */
    right: 15px; /* Sağdan boşluk */
    color: #fff; /* Beyaz renk */
    font-size: 36px; /* Daha büyük */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 10; /* En önde */
    background: none; /* Arka plan yok */
    border: none; /* Kenarlık yok */
    padding: 0; /* İç boşluk yok */
    line-height: 1; /* Çizgi yüksekliği */
    cursor: pointer;
}

.bp-stories-close-viewer:hover {
    opacity: 0.8;
}


/* Menü ikonu (3 nokta) ve menüsü artık yok */
#bp-stories-viewer-options-btn,
#bp-stories-viewer-options-menu {
    display: none !important; /* HTML'den kaldırılsa da, emin olmak için */
}


.bp-stories-viewer-media {
    width: 100%;
    height: 100%; /* Fill parent flex item */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For positioning GIF/Sticker overlays */
    flex-grow: 1; /* Allow media to grow and take available space */
}

.bp-stories-viewer-media img,
.bp-stories-viewer-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure media fits within bounds */
}
.bp-stories-viewer-overlay { /* Overlay for GIFs/Stickers on viewer */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 40%; /* Adjust size as needed */
    max-height: 40%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2; /* Above media, below user info/interactions */
}


/* Navigation buttons */
.bp-stories-nav-left, .bp-stories-nav-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.0); /* Transparent until hover */
    color: #fff;
    border: none;
    padding: 0 15px; /* Wider click area */
    font-size: 3em;
    cursor: pointer;
    z-index: 7;
    height: 100%; /* Make full height for easier clicks */
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}
.bp-stories-nav-left:hover, .bp-stories-nav-right:hover {
    background-color: rgba(0,0,0,0.2);
}

.bp-stories-nav-left { left: 0; }
.bp-stories-nav-right { right: 0; }


/* Bottom interaction area (like and comment icons) */
#bp-stories-viewer-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(0,0,0,0.5); /* Semi-transparent background */
    z-index: 6;
    box-sizing: border-box;
    min-height: 60px;
}

#bp-stories-viewer-bottom-bar #bp-stories-comment-input {
    flex-grow: 1; /* Genişlesin */
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 15px;
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.9em;
    outline: none;
    box-sizing: border-box;
    margin-right: 10px; /* İkonlardan ayırmak için */
}
#bp-stories-viewer-bottom-bar #bp-stories-comment-input::placeholder {
    color: rgba(255,255,255,0.7);
}

#bp-stories-viewer-bottom-bar .bp-stories-icon-btn {
    background: none; /* Arka plan yok */
    border: none;
    color: #fff; /* Beyaz renk */
    font-size: 1.8em;
    padding: 5px;
    cursor: pointer;
    margin-left: 10px; /* İkonlar arası boşluk */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.3s ease-in-out, color 0.2s ease;
}
#bp-stories-viewer-bottom-bar .bp-stories-icon-btn:hover {
    opacity: 0.8;
}
#bp-stories-viewer-bottom-bar .bp-stories-icon-btn .dashicons {
    color: #fff; /* Dashicon rengini beyaz yap */
    font-size: 0.9em;
}
#bp-stories-viewer-bottom-bar #bp-stories-like-btn .dashicons-heart-filled {
    color: red !important;
}

#bp-stories-viewer-bottom-bar .bp-stories-send-button {
    background-color: transparent;
    border: none;
    color: #0073aa; /* WordPress blue */
    padding: 5px 10px;
    margin-left: 10px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s ease;
}
#bp-stories-viewer-bottom-bar .bp-stories-send-button:hover {
    color: #008ec2;
}


/* Comments section is hidden by default, shown when input is clicked */
#bp-stories-comments-section {
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    position: absolute;
    bottom: 60px; /* Above the input area */
    left: 0;
    right: 0;
    max-height: calc(100% - 140px); /* Adjust height to fit above input area and below header */
    overflow-y: auto;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

#bp-stories-comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#bp-stories-comments-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}
#bp-stories-comments-list li:last-child {
    border-bottom: none;
}

#bp-stories-comments-list li strong {
    margin-right: 5px;
    color: #eee;
}
#bp-stories-comments-list li span {
    word-break: break-word; /* Allow long words to break */
}

/* Report Story Modal */
#bp-stories-report-modal .bp-stories-modal-content {
    max-width: 450px;
}

#bp-stories-report-modal textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    min-height: 100px;
}
#bp-stories-report-modal .button-primary {
    width: auto;
    margin-top: 15px;
}


/* Admin notice styles (optional, for debug or specific messages) */
.bp-stories-pro-admin-notice {
    margin-left: 0;
}

/* Modal body class to prevent scrolling when modal is open */
body.bp-stories-modal-open {
    overflow: hidden;
}

/* Featured Stories Section on Profile */
.bp-stories-featured-header {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bp-stories-featured-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}


#bp-stories-featured-wrapper {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
    gap: 15px;
    text-align: center;
}

.bp-featured-story-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    padding: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer; /* Make them clickable if they open viewer */
}

.bp-featured-story-item img,
.bp-featured-story-item video {
    width: 100%;
    height: 120px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 5px;
}

.bp-featured-story-content {
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Responsive Adjustments (General for viewer modal) */
@media (max-width: 768px) {
    #bp-stories-viewer-modal {
        padding: 0 !important; /* Remove padding for full screen */
    }
    #bp-stories-viewer-modal .bp-stories-modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    #bp-stories-viewer-inner {
        border-radius: 0 !important;
        /* Ensure no padding on inner if content goes edge to edge */
    }

    .bp-stories-viewer-user-info img {
        width: 30px;
        height: 30px;
    }

    #bp-stories-viewer-bottom-bar .bp-stories-icon-btn {
        font-size: 1.5em;
    }

    .bp-stories-nav-left, .bp-stories-nav-right {
        padding: 0 5px;
        font-size: 2em;
    }

    /* Kapatma ikonu küçük ekranlarda daha uygun boyutta ve konumda */
    .bp-stories-close-viewer {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
}