/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #FF9F1C;
    /* Orange */
    --secondary: #2EC4B6;
    /* Light Blue/Cyan */
    --accent: #FF99C8;
    /* Light Pink */
    --highlight: #FFBF00;
    /* Yellow */
    --dark: #0F0F0F;
    /* Black/Dark Gray */
    --surface: #1A1A1A;
    /* Slightly lighter dark */
    --text: #F0F0F0;
    --text-muted: #A0A0A0;

    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--dark);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

ul {
    list-style: none;
}

/* --- Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--highlight);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--highlight);
    transition: 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Section (Stream) --- */
.hero {
    padding: 2rem 5%;
    text-align: center;
}

.stream-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: default;
}

.tag-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- Post Type Toggle --- */
.post-type-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    cursor: pointer;
}

.toggle-btn input {
    display: none;
}

.toggle-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.toggle-btn input:checked+span {
    background: var(--primary);
    color: var(--dark);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.3);
}

/* --- Status Badge --- */
.status-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.status-badge .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-badge.live {
    border-color: #ff4d4d;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.3);
}

.status-badge.live .dot {
    background: #ff4d4d;
    box-shadow: 0 0 8px #ff4d4d;
    animation: blink 1.5s infinite;
}

.status-badge.offline {
    opacity: 0.7;
}

.status-badge.offline .dot {
    background: #555;
}

@keyframes blink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.stream-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 159, 28, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

iframe,
#leezi {
    width: 100%;
    height: 100%;
}

/* --- Entrance Animations --- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.recipe-card {
    animation: fadeSlideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Stagger indices if generated by JS - we can handle this in ui.js or with CSS nth-child */
.recipe-card:nth-child(1) {
    animation-delay: 0.1s;
}

.recipe-card:nth-child(2) {
    animation-delay: 0.15s;
}

.recipe-card:nth-child(3) {
    animation-delay: 0.2s;
}

.recipe-card:nth-child(4) {
    animation-delay: 0.25s;
}

.recipe-card:nth-child(5) {
    animation-delay: 0.3s;
}

.recipe-card:nth-child(6) {
    animation-delay: 0.35s;
}

.recipe-card:nth-child(n+7) {
    animation-delay: 0.4s;
}


.offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.offline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* --- Search Bar --- */
.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

#recipe-search {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    outline: none;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

#recipe-search:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 159, 28, 0.3);
}

#recipe-search::placeholder {
    color: var(--text-muted);
}

/* --- Recipes Section --- */
.recipes {
    padding: 4rem 5%;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

h2 span {
    color: var(--primary);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: var(--accent);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.recipe-card:hover .card-image img {
    transform: scale(1.1);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: #252525;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.5rem;
    font-size: 0.9rem;
}

.no-image-placeholder i {
    font-size: 2rem;
    opacity: 0.3;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: 0.3s;
}

.recipe-card:hover .play-icon {
    opacity: 1;
}

.card-content {
    padding: 1rem;
}

.card-content h3 {
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    color: var(--secondary);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Modal & Recipe/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--surface);
    margin: auto;
    padding: 2rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    /* Fix overlap */
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 10;
    background: var(--surface);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 2rem;
}

.video-container {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

/* Metadata (Time, Difficulty) */
.recipe-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
    font-size: 1.1rem;
    color: var(--secondary);
}

.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--dark);
    text-transform: uppercase;
}

.difficulty-badge.easy {
    background: #2EC4B6;
}

/* Cyan */
.difficulty-badge.medium {
    background: #FF9F1C;
}

/* Orange */
.difficulty-badge.hard {
    background: #FF99C8;
}

/* Pink */

/* Details Grid */
.recipe-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .recipe-details-grid {
        grid-template-columns: 1fr;
    }
}

.ingredients-list,
.instructions-list {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.ingredients-list h4,
.instructions-list h4 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.ingredients-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.ingredients-list li::before {
    content: '•';
    color: var(--accent);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.instructions-list ol {
    list-style: none;
    counter-reset: step-counter;
}

.instructions-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.instructions-list li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--accent);
    color: var(--dark);
    border-radius: 50%;
    text-align: center;
    line-height: 1.5rem;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- Socials Page --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 5%;
    flex-wrap: wrap;
    background: linear-gradient(to bottom, var(--dark), var(--surface));
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.social-btn i {
    font-size: 1.4rem;
    color: var(--current-color);
    transition: 0.3s;
}

.social-btn:hover {
    transform: translateY(-5px);
    border-color: var(--current-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.1);
}

.feeds-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.social-feed {
    flex: 1;
    min-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 2rem;
    height: fit-content;
}

.social-feed h3 {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.feed-content {
    max-height: 800px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) var(--surface);
}

.behold-feed-wrapper {
    min-height: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.behold-feed-wrapper behold-widget {
    width: 100%;
}

.twitter-feed-wrapper {
    min-height: 300px;
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

/* Instagram Grid Style */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    /* Insta style grid */
    gap: 0.5rem;
}

.gallery-item {
    aspect-ratio: 1/1;
    /* Square posts */
    border-radius: 4px;
    /* Slight rounded corners like modern UI */
    overflow: hidden;
    position: relative;
    border: none;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

.gallery-item .overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    color: white;
    font-weight: bold;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--dark);
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-btn {
        display: block;
    }

    .gallery {
        column-count: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Scroll to Top --- */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--dark);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    background: var(--highlight);
}

/* --- FAQ Page Styles --- */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.faq-card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 2rem;
    height: 100%;
}

.faq-image-container {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    /* max-height: 300px; */
    /* Optional constraint */
}

.faq-image-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Or cover depending on image aspect ratio */
    display: block;
}

.faq-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: left;
}

.faq-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.faq-content .highlight-text {
    color: var(--accent);
    font-weight: bold;
    margin-top: 1.5rem;
    text-align: center;
}

.faq-qa {
    margin-bottom: 2rem;
}

.faq-qa h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Modal Header & Controls --- */
.modal-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--text);
    margin: 0 0 1rem 0;
    text-align: center;
}

/* Modal Controls Bar (Horizontal) */
.modal-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.05), rgba(255, 105, 180, 0.05));
    padding: 12px 20px;
    border-radius: 20px;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 165, 0, 0.1);
}

.control-divider {
    width: 2px;
    height: 28px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
    margin: 0 5px;
}

/* Servings Control */
.servings-control {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: transparent;
    padding: 0;
    border: none;
}

.servings-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.servings-label i {
    color: var(--primary);
    font-size: 1.1rem;
}

.serv-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: bold;
}

.serv-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.serv-btn:active {
    transform: scale(0.95);
}

#serv-count {
    font-size: 1.4rem;
    font-weight: 800;
    min-width: 30px;
    text-align: center;
    color: var(--primary);
}

/* Share Button */
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    background: white;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.icon-btn:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 6px 16px rgba(255, 105, 180, 0.4);
}

.icon-btn:active {
    transform: translateY(-1px) rotate(0deg);
}

/* --- Simple Post (Social Media Style) --- */
.simple-post-content {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.simple-post-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-line;
    /* Preserves formatting */
    text-align: left;
}

/* --- Twitter Embed Dark Mode / Size Fixes --- */
.twitter-feed-wrapper {
    min-height: 500px;
    background: var(--surface);
    border-radius: 12px;
    padding: 0;
    display: flex;
    justify-content: center;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* --- Gallery Editor (Admin) --- */
.gallery-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.gallery-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    background: #eee;
    transition: all 0.2s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item.is-cover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.gallery-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 10;
}

.gallery-item .cover-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 159, 28, 0.9);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
    display: none;
    font-weight: bold;
}

.gallery-item.is-cover .cover-badge {
    display: block;
}

.gallery-item:hover .set-cover-btn {
    display: flex;
    /* Show overlay on hover */
}

/* Invisible overlay click target to set cover */
.set-cover-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

.modal-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 1.5rem 0;
}

.modal-gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.modal-gallery-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.modal-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #2ecc71;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-info {
    border-left-color: var(--primary);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}

.toast-close:hover {
    color: var(--text);
}

/* --- Lightbox --- */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 2rem;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-height: 90vh;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    width: 60px;
    height: 80px;
    display: none;
    z-index: 1000;
    transition: 0.3s;
    border-radius: 4px;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: none;
}