/* =================================================================== */
/*                          STYLE.CSS - AI GENERATION                  */
/* =================================================================== */

/* ===== ROOT & GLOBAL STYLES ===== */
:root {
    /* Main color palette for the "Golden AI" dark theme */
    --primary-color: #FFD700;        /* Main accent color, a vibrant gold. */
    --primary-color-hover: #E6C300;  /* A slightly darker gold for hover effects. */
    
    --text-color: #F0F2F5;           /* A very light, soft white for primary text. */
    --secondary-text-color: #a0a7b0; /* Muted light gray for less important text. */

    --background-color: #1a1a1a;     /* Deep black for the main background. */
    --surface-color: #2a2a2e;        /* Color for cards, headers, and input fields. */
    --border-color: #404245;         /* Subtle border color for definition. */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
    color: var(--secondary-text-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color-hover);
}

section {
    padding: 60px 0;
}
/* ===== END ROOT & GLOBAL STYLES ===== */


/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
/* ===== END LAYOUT ===== */


/* ===== HEADER & NAVIGATION (V11 - RELIABLE FIX) ===== */

/* --- General Header Styles --- */
header {
    background: transparent;
    padding: 15px 0;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    z-index: 100;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Logo --- */
.logo-video {
    max-height: 40px;
    width: auto;
    display: block;
}

/* --- Universal Structure --- */
.main-nav {
    flex-grow: 1;
    padding-left: 50px;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.mobile-nav-toggle {
    display: none; /* Hidden by default */
    z-index: 1001;
    /* (Styles for burger icon itself are assumed to be correct) */
}
/* --- Стилизация самой иконки-бургера --- */
.mobile-nav-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px; /* Делает область нажатия удобнее */
}

.burger-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color); /* Центральная полоска */
    transition: background-color 0.3s ease;
}

.burger-icon::before,
.burger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, top 0.3s ease;
}

.burger-icon::before {
    top: -7px; /* Верхняя полоска */
}

.burger-icon::after {
    top: 7px; /* Нижняя полоска */
}

/* Стили для крестика (когда меню активно), эти правила у тебя уже есть, но проверим их */
header.mobile-nav-active .burger-icon { background: transparent; }
header.mobile-nav-active .burger-icon::before { transform: translateY(7px) rotate(45deg); }
header.mobile-nav-active .burger-icon::after { transform: translateY(-7px) rotate(-45deg); }
/* ===== END HEADER & NAVIGATION (V11 - RELIABLE FIX) ===== */


/* ===== FINAL HEADER RESPONSIVENESS (BUG-01 FIX) ===== */

/* --- На десктопе (> 768px) --- */
/* Прячем специальный контейнер для мобильного меню по умолчанию */
.mobile-menu-items {
    display: none;
}


/* --- На мобильных устройствах (<= 768px) --- */
@media (max-width: 768px) {

    /* 1. ПРЯЧЕМ ДЕСКТОПНЫЕ ЭЛЕМЕНТЫ (Этот блок корректен и остается без изменений) */
    .desktop-only,                           
    .is-guest .header-actions,               
    .header-balance,
    .header-top-up-btn,
    .filter-container,
    .is-logged-in .main-nav li {             
        display: none;
    }
    .is-logged-in .main-nav {
        flex-grow: 0;
        padding-left: 0;
    }

    /* 2. ПОКАЗЫВАЕМ КНОПКУ-БУРГЕР (Этот блок корректен и остается) */
    .is-guest .mobile-nav-toggle {
        display: block;
    }
    
    /* 3. ОПИСЫВАЕМ ВЫЕЗЖАЮЩЕЕ МЕНЮ (ИСПРАВЛЕНО) */
    /* Теперь стили применяются к .main-nav напрямую, без зависимости от <header> */
    .main-nav {
        display: block; /* Убедимся, что контейнер видимый, даже если его ссылки скрыты */
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: var(--surface-color);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        padding-top: 80px;
        z-index: 1000;
        /* Изначально меню скрыто за экраном */
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }

    /* 4. АНИМАЦИЯ ПОЯВЛЕНИЯ МЕНЮ (ИСПРАВЛЕНО И УПРОЩЕНО) */
    /* Теперь для показа меню нужен ТОЛЬКО класс .active-nav на самом элементе <nav> */
    .main-nav.active-nav {
        transform: translateX(0);
    }
    
    /* 5. СТИЛИЗУЕМ КОНТЕНТ ВНУТРИ МЕНЮ (ИСПРАВЛЕНО) */
    /* Эти стили теперь сработают, так как они больше не зависят от <header> */
    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
    }
    
    .main-nav .mobile-menu-items {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        padding: 0;
    }
    .main-nav .mobile-menu-items a {
        padding: 15px 20px;
        width: 100%;
        font-size: 1.2rem;
        color: var(--text-color); /* Убедимся, что цвет текста правильный */
    }
     .main-nav .mobile-menu-items a:hover {
        color: var(--primary-color);
        background-color: rgba(255, 255, 255, 0.05);
     }
    .main-nav .mobile-menu-items .mobile-buttons {
        padding: 20px;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    .main-nav .mobile-menu-items .mobile-buttons a {
        text-align: left; 
        padding-left: 20px; 
        padding-right: 20px; 
    }
    
    .main-nav .mobile-menu-items .mobile-buttons .cta-button-secondary {
        margin-left: 0;
    }
    
    /* 6. АНИМАЦИЯ БУРГЕРА В КРЕСТИК (Остается без изменений) */
    /* Эта часть может работать или не работать в зависимости от JS, но она не влияет на открытие меню */
    header.mobile-nav-active .burger-icon { background: transparent; }
    header.mobile-nav-active .burger-icon::before { transform: translateY(7px) rotate(45deg); }
    header.mobile-nav-active .burger-icon::after { transform: translateY(-7px) rotate(-45deg); }
}
/* ===== END HEADER RESPONSIVENESS (BUG-01 FIX) ===== */

/* ===== HEADER ACTIONS & DROPDOWNS (V2.1 ADDITIONS) ===== */
/* Base style for icon buttons in the header */
.header-icon-btn {
    background: transparent;
    border: none;
    color: var(--secondary-text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}
.header-icon-btn:hover {
    color: var(--text-color);
    background-color: var(--surface-color);
}
.header-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Container for the filter functionality */
.filter-container {
    position: relative;
}

/* The dropdown panel */
.filter-dropdown {
    position: absolute;
    top: 150%; /* Position below the header */
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 220px;
    padding: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.filter-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-title {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    padding: 8px 12px;
    margin: 0;
}

/* List of items inside the dropdown */
.filter-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual filter item */
.filter-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.filter-item label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.filter-item label span {
    flex-grow: 1; /* Pushes checkbox to the right */
    font-size: 1rem;
    color: var(--text-color);
}
.filter-item label svg {
    color: var(--secondary-text-color);
}

/* Hide default checkbox and style custom one later if needed */
.filter-item input[type="checkbox"] {
    /* Basic styling for now */
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Style for the profile icon */
.profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #3e3e42;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.profile-icon:hover {
    transform: scale(1.1);
    color: var(--text-color);
}
/* New button for "Top-Up" in the header */
.header-top-up-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-text-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-top-up-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #1a1a1a; /* Dark text for high contrast on gold */
}
/* ===== END HEADER ACTIONS & DROPDOWNS (V2.1 ADDITIONS) ===== */


/* ===== GENERAL COMPONENTS ===== */
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: #1a1a1a; /* Dark text on gold button for high contrast */
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.cta-button:hover {
    background: var(--primary-color-hover);
    color: #000;
}

.cta-button-secondary {
    display: inline-block;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    padding: 13px 25px; /* Adjust padding to align height */
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-left: 15px;
}
.cta-button-secondary:hover {
    color: var(--primary-color-hover);
    border-color: var(--primary-color);
}

.header-signup-btn {
    margin-left: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    background-color: var(--surface-color);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
/* ===== END GENERAL COMPONENTS ===== */


/* ===== HERO SECTION (V2 - VIDEO BACKGROUND) ===== */
.hero-section {
    position: relative;
    height: 100vh; /* Takes 100% of the viewport height */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.hero-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Puts it at the very back */
}

.hero-video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the video cover the area without stretching */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 60% black overlay */
    z-index: 2; /* Places it on top of the video */
}

.hero-content {
    position: relative;
    z-index: 3; /* Places content on top of the overlay */
    text-align: center;
    width: 100%;
}

/* Specific styling for the Logged-in view prompt container */
.prompt-container-main {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(0,0,0,0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-container-main h1 {
    font-size: 2.5rem;
    color: #fff;
}
.prompt-container-main p {
    color: rgba(255, 255, 255, 0.7);
}

/* Adapt the form for the new container */
.prompt-container-main #generation-form {
    margin: 0;
}
.prompt-container-main .prompt-wrapper {
    background: rgba(0,0,0,0.25);
}
.prompt-container-main textarea#prompt-input {
    min-height: 80px;
}
.prompt-container-main #generate-button {
    margin-top: 15px;
    width: 100%;
}
/* ===== END HERO SECTION (V2 - VIDEO BACKGROUND) ===== */


/* ===== EXPLORE SECTION (LOGGED-IN) ===== */
.explore-section {
    padding-top: 120px;
    padding-bottom: 180px;
}

/* The Prompt Form Container at the top */
.prompt-container-main {
    max-width: 800px;
    margin: 0 auto 60px auto;
}
/* ... (остальные стили для .prompt-container-main, они правильные и их не нужно менять) ... */
.prompt-container-main .prompt-wrapper { display: flex; /*...*/ }
.prompt-container-main textarea#prompt-input { flex-grow: 1; /*...*/ }
.prompt-container-main #generate-button, .prompt-container-main .cta-button { width: 100%; /*...*/ }


/* ===== THE MAIN GALLERY GRID (V3 - SIZER METHOD) ===== */

.results-gallery.masonry-grid {
    width: 100%;
    margin: 0 auto 40px auto;
}

/* 
  The Sizer element and Grid items will share width properties.
  The Sizer is invisible but defines the column width for Masonry.
*/

.grid-sizer,
.grid-item {
    /* Base width for DESKTOP (3 columns) */
    width: 32%;
}

/* Individual visible items in the grid */
.grid-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
    outline: none;
}
.grid-item img {
    width: 100%;
    height: auto;
    display: block;
}


/* ===== ADAPTIVE GRID RULES (V3 - SIZER METHOD) ===== */

/* Tablets & Small Desktops (2 columns) */
@media (max-width: 992px) {
    .grid-sizer,
    .grid-item {
        width: 48%; /* Each item takes nearly half the width */
    }
}

/* Mobile phones (1 column) */
@media (max-width: 768px) {
    .grid-sizer,
    .grid-item {
        width: 100%; /* One item takes full width */
    }
}
/* ===== END EXPLORE SECTION ===== */

/* Container for the load more button */
.load-more-container {
    text-align: center;
    padding: 20px 0;
}

/* Styling for items in the gallery */
.grid-item {
    /* Base width for Desktop (3 columns) */
    width: 32%; 
    margin-bottom: 15px;
    float: left;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
}
.grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Container for the load more button */
/* ... (ваш .load-more-container) */

/* ===== ADAPTIVE GRID FOR GALLERY ===== */

/* Tablets (2 columns) */
@media (max-width: 992px) {
    .grid-item {
        width: 48%; /* (100% / 2) - margins */
        margin: 1%;
    }
}

/* Mobile phones (1 column) */
@media (max-width: 768px) {
    .grid-item {
        width: 100%; /* Full width */
        margin: 0 0 15px 0; /* Only bottom margin */
    }
}

/* Visibility helpers for navigation */
.mobile-nav-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}
/* On screens larger than 768px, hide mobile-only elements */
@media (min-width: 769px) {
    .mobile-auth-buttons-wrapper { display: none; }
}
/* On screens smaller than 768px, hide desktop-only elements */
@media (max-width: 768px) {
    .desktop-only { display: none; }
}
/* ===== END RESPONSIVE ADJUSTMENTS FOR GRID ITEMS ===== */


/* ===== AUTHENTICATION PAGES (LOGIN/REGISTER) ===== */
.auth-section {
    padding: 80px 0;
}
.auth-form-container {
    max-width: 450px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}
.auth-form-container h2 {
    margin-bottom: 10px;
    color: var(--text-color);
}
.auth-form-container p {
    margin-bottom: 30px;
}
.auth-form-container .form-group {
    text-align: left;
}
.auth-form-container .cta-button {
    width: 100%;
    margin-top: 15px;
}
.auth-switch-link {
    margin-top: 25px;
    font-size: 0.9rem;
}

/* This wrapper will help center the form vertically on the page */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Full viewport height */
    padding-top: 80px;  /* Offset for the header */
    padding-bottom: 40px;
}

.auth-logo {
    display: block;
    margin: 0 auto 20px auto;
    width: 60px; /* Adjust size as needed */
}

/* Form error/success messages */
.form-error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.form-success-message {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Logo at the top of the auth forms */
.auth-logo-link {
    display: block;
    width: 60px; /* Adjust the size as needed */
    margin: 0 auto 30px auto; /* Center the logo and add space below */
    transition: transform 0.3s ease;
}
.auth-logo-link:hover {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}
.auth-logo-link img {
    width: 100%;
    height: auto;
    border-radius: 8px; /* Slightly rounded corners if the poster has a background */
}
/* ===== END AUTHENTICATION PAGES (LOGIN/REGISTER) ===== */


/* ===== CABINET PAGE (USER ACCOUNT) ===== */
.cabinet-section {
    padding: 80px 0;
}

.cabinet-section h2,
.cabinet-section > .container > p {
    text-align: center;
}

.cabinet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

.cabinet-block {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
.cabinet-block h3 {
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* Make the history block span two columns */
.history-block {
    grid-column: 1 / -1;
}

/* Balance display */
.balance-display {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
}
.cabinet-block .cta-button {
    width: 100%;
}

/* User details styles */
.user-details p {
    margin-bottom: 15px;
}
.user-details p strong {
    color: var(--text-color);
}

/* History table styles */
.history-table-container {
    max-height: 300px;
    overflow-y: auto; /* Adds a scrollbar if the content is too tall */
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    background-color: var(--background-color);
}
td:last-child {
    font-weight: 600;
    text-align: right;
}
.amount-credit {
    color: #2ecc71; /* A nice green color */
}
.amount-debit {
    color: #e74c3c; /* A nice red color for debits */
}

/* Logout link container */
.logout-link-container {
    text-align: center;
    margin-top: 40px;
}
.logout-link-container a {
    color: var(--secondary-text-color);
    text-decoration: underline;
}
/* ===== END CABINET PAGE (USER ACCOUNT) ===== */


/* ===== TOP-UP PAGE (Final Version) ===== */

/* Styles for preset amount buttons - these are fine */
.preset-amounts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.preset-amount-btn {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.preset-amount-btn:hover {
    border-color: var(--primary-color);
}
.preset-amount-btn.active {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}


/* NEW & CORRECTED STYLES FOR THE INPUT AND LABELS */

/* Display for the currency conversion rate */
.conversion-rate {
    padding: 10px 15px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}
.conversion-rate strong {
    color: var(--text-color);
}

/* Wrapper for the input field */
.amount-input-wrapper {
    position: relative;
}

/* --- Default State (No text in input) --- */
.amount-input-wrapper .currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    pointer-events: none;
    transition: opacity 0.2s ease;
    opacity: 0; /* The symbol is HIDDEN by default */
}

.amount-input-wrapper input[type="text"] {
    padding-left: 15px; /* Placeholder starts at the left edge */
    transition: padding-left 0.2s ease;
}

/* --- Active State (when the wrapper has the .has-value class) --- */
.amount-input-wrapper.has-value .currency-symbol {
    opacity: 1; /* The symbol becomes VISIBLE */
}
.amount-input-wrapper.has-value input[type="text"] {
    padding-left: 35px; /* Input text is PUSHED to the right */
}

/* Small helper text below the input field */
.amount-helper-text {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    text-align: center;
    color: var(--secondary-text-color);
}

/* Ensure the main button is full width */
#topup-form .cta-button {
    width: 100%;
    margin-top: 20px;
}
/* ===== END TOP-UP PAGE (Final Version) ===== */

/* ===== POLICY PAGES ===== */
.policy-page ul {
    list-style-position: inside;
    padding-left: 5px;
}
.policy-section,
.text-content-section {
    padding: 140px 0 80px 0; /* Extra top padding for the transparent header */
}

.policy-container,
.text-content-container {
    max-width: 800px; /* Optimal width for reading text */
    margin: 0 auto;
}

.policy-container h1,
.text-content-container h1 {
    font-size: 3rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 25px;
}

.policy-container h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.policy-container p,
.text-content-container p {
    line-height: 1.8;
    color: var(--secondary-text-color);
}

.policy-container ul {
    list-style-position: outside; /* Bullets outside the text block */
    padding-left: 25px; /* Indent the list */
    margin: 20px 0;
}

.policy-container ul li {
    margin-bottom: 12px;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

.last-updated,
.page-lead {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 40px;
}
/* ===== END POLICY PAGES ===== */


/* ===== FOOTER ===== */
footer {
    background-color: #000000;
    color: #bdc3c7;
    padding: 60px 0 20px 0;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-col p {
    color: var(--secondary-text-color);
    line-height: 1.8;
    margin: 0 0 10px 0;
}

.payment-logos {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.payment-logos img {
    height: 25px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.payment-logos img:hover {
    filter: none;
    opacity: 1;
}

@media(max-width: 992px){ 
    .footer-grid { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}
@media(max-width: 768px){ .footer-grid { grid-template-columns: 1fr; } }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 30px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}
.footer-policy-links {
    margin-bottom: 15px;
}
.footer-policy-links a {
    color: var(--secondary-text-color);
    margin: 0 7px;
}
.footer-policy-links a:hover {
    color: var(--primary-color);
}
.footer-bottom p {
    margin: 0;
}
.footer-grid {
    /* Updated for 4 columns */
    grid-template-columns: repeat(4, 1fr);
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--secondary-text-color);
}
.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
/* Responsive adjustments for new footer grid */
@media(max-width: 992px){ .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 768px){ .footer-grid { grid-template-columns: 1fr; } }
/* ===== END FOOTER ===== */

/* ===== PUBLIC GALLERY PREVIEW SECTION (Guest View) ===== */
.preview-gallery-section {
    padding: 80px 0;
    background-color: var(--background-color); /* Matches the main theme */
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px auto;
}
.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.section-header p {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
}
/* ===== END: PUBLIC GALLERY PREVIEW SECTION (Guest View) ===== */

/* ===== GUEST PREVIEW GRID (V2 - PURE CSS GRID) ===== */

.guest-preview-grid {
    display: grid;
    /* Create 3 equal-width columns */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; /* Space between items */
    width: 100%;
}

.grid-item-guest {
    border-radius: 8px;
    overflow: hidden;
    /* This creates a nice subtle zoom effect on hover */
    transition: transform 0.3s ease;
}
.grid-item-guest:hover {
    transform: scale(1.03);
}

.grid-item-guest img {
    width: 100%;
    height: 100%;
    /* Ensure the image fills the grid area without stretching */
    object-fit: cover;
    display: block;
}

/* --- Responsiveness for the new grid --- */
@media (max-width: 992px) {
    .guest-preview-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
    }
}

@media (max-width: 768px) {
    .guest-preview-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
    }
}
/* ===== END: GUEST PREVIEW GRID (V2 - PURE CSS GRID) ===== */

/* ===== HOW IT WORKS SECTION ===== */
.how-it-works-section {
    padding: 80px 0;
    /* We use a subtle gradient to distinguish the section */
    background: linear-gradient(180deg, var(--background-color) 0%, #111 100%);
    border-top: 1px solid var(--border-color);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.process-card {
    background: var(--surface-color);
    padding: 35px 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.process-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color);
}

.process-icon {
    margin: 0 auto 30px auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* A circle with a soft inner shadow to contain the icon */
    background: var(--background-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.process-icon svg {
    /* The icon will be our primary gold color */
    color: var(--primary-color);
}

.process-card h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}
.process-card p {
    font-size: 0.95rem;
    color: var(--secondary-text-color);
}


/* --- Responsiveness for the "How It Works" section --- */
@media (max-width: 992px) {
    .process-grid {
        /* On tablets, we switch to a single column layout */
        grid-template-columns: 1fr;
    }
}
/* ===== END: HOW IT WORKS SECTION ===== */

/* ===== CABINET & TABS (V2) ===== */

.cabinet-section .section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 30px auto;
}
.cabinet-section .section-header h2 {
    font-size: 2.5rem;
}

/* Prominent Balance Widget */
.balance-widget {
    max-width: 800px;
    margin: 0 auto 40px auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* For mobile */
    gap: 20px;
}
.balance-info {
    display: flex;
    flex-direction: column;
}
.balance-label {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-bottom: 5px;
}
.balance-amount {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 700;
}
.balance-widget .cta-button {
    font-size: 1rem;
    padding: 12px 25px;
}

/* Tab Navigation Buttons */
.tabs-nav {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.tab-btn {
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tab-btn:hover {
    background-color: var(--surface-color);
    color: var(--text-color);
}
.tab-btn.active {
    background-color: var(--primary-color);
    color: #1a1a1a;
    border-color: var(--primary-color);
}

/* Tab Content Panes */
.tab-pane {
    display: none; /* Hidden by default */
}
.tab-pane.active {
    display: block; /* Visible when active */
}

.empty-gallery-message {
    text-align: center;
    padding: 50px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    color: var(--secondary-text-color);
}

/* Grid for Account Info & History */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.cabinet-block {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
}
.cabinet-block h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}
/* User details text */
.user-details p {
    margin-bottom: 15px;
}
.user-details p strong {
    color: var(--text-color);
}

.logout-link-container {
    text-align: center;
    margin-top: 50px;
}

/* === Responsive adjustments for Cabinet === */
@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .balance-widget {
        flex-direction: column;
        text-align: center;
    }
    .balance-widget .cta-button {
        width: 100%;
    }
}

.empty-gallery-container {
    width: 100%;
}
/* ===== END CABINET & TABS (V2) ===== */

/* ===== STICKY PROMPT BAR (V4 - FIXED TO VIEWPORT) ===== */

/* This container is now fixed to the viewport */
.sticky-prompt-bar {
    position: fixed;            /* CHANGE: The key change from 'sticky' to 'fixed' */
    bottom: 20px;               /* Position 20px from the bottom of the screen */
    left: 50%;                  /* Center the element... */
    transform: translateX(-50%);/* ...using this transform trick */
    width: calc(100% - 40px);   /* Make it almost full-width with some padding */
    max-width: 800px;           /* But not wider than 800px on large screens */
    z-index: 50;                /* Ensure it's on top of all other content */
    /* margin-top is no longer needed as it's out of the document flow */
}

/* This is the form itself, where we apply the glassmorphism effect */
.generation-form-v2 {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px;
    
    /* NEW: More transparency and blur for a better "glass" effect */
    background: rgba(30, 30, 32, 0.75); /* More see-through */
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    
    border: 1px solid rgba(255, 255, 255, 0.1); /* A subtle white border for the glass edge */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Area for the main text input and send button */
.prompt-main-area {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

textarea#prompt-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 10px 5px;
    resize: none;
    overflow-y: hidden; /* We handle growth via JS */
    line-height: 1.5;
    max-height: 200px; /* Limit max growth */
}

.generate-arrow-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
}
.generate-arrow-btn:hover {
    transform: scale(1.1);
}
.generate-arrow-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: scale(1);
}

/* Area for the option buttons */
.prompt-options-area {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 0 5px;
}

.option-group {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 4px;
}

/* Buttons like "Image" / "Video" */
.option-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--secondary-text-color);
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.option-btn.active {
    background: #6e6e72;
    color: var(--text-color);
}
/* Iconic buttons for options like resolution */
.option-btn-iconic {
    padding: 6px 12px;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    font-weight: 500;
}
/* Initially hide the duration option */
#duration-option {
    display: none; 
}
/* ===== END: STICKY PROMPT BAR (V3) ===== */

/* ===== PROMPT OPTIONS V2 - DROPDOWNS ===== */

/* Individual dropdown container */
.option-dropdown {
    position: relative; /* Anchor for the absolute positioned menu */
}

/* The button that shows the currently selected value */
.dropdown-toggle {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: var(--secondary-text-color);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex; /* Make the button a flex container */
    align-items: center;
    gap: 8px; /* Space between icon and text */
}

.dropdown-toggle svg {
    width: 16px; /* Icon size */
    height: 16px;
}

/* Style for the new title inside the dropdown menu */
.dropdown-menu-title {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Style to hide options that are not relevant */
.option-dropdown[data-dependency="video"] {
    display: none; /* Hidden by default */
}

/* The menu that appears on click */
.dropdown-menu {
    position: absolute;
    bottom: 120%; /* Position it above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 51;
    min-width: 100px; /* Give it some width */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu button {
    background: transparent;
    border: none;
    color: var(--secondary-text-color);
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}
.aspect-ratio-group {
    display: none;
}
/* ===== END: PROMPT OPTIONS V2 - DROPDOWNS ===== */

/* ===== CONTACT FORM COMPONENT (FOR POLICY PAGES) ===== */

.contact-section-component {
    padding: 80px 0;
    margin-top: 40px; /* Add some space above the form section */
    background-color: var(--surface-color); /* Use the surface color to stand out */
    border-top: 1px solid var(--border-color);
}

.contact-form-component {
    max-width: 700px;
    margin: 0 auto;
    /* We don't need a separate background as the section already has one */
}
.contact-form-component button {
    width: 100%;
}
/* ===== END CONTACT FORM COMPONENT (FOR POLICY PAGES) ===== */

/* ===== UTILITY PAGES (404, THANK YOU) ===== */
.utility-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

.utility-content-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.utility-icon {
    color: var(--primary-color);
    margin-bottom: 30px;
}
.utility-icon.--success {
    color: #2ecc71; /* A consistent success green */
}

.utility-content-container h1 {
    font-size: 3rem;
    color: var(--text-color);
}
.utility-content-container p {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    margin-bottom: 40px;
}
/* ===== END UTILITY PAGES (404, THANK YOU) ===== */

/* ===== FEATURE SHOWCASE SECTION ===== */
.feature-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.feature-grid {
    display: grid;
    /* Create 3 columns on desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.feature-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to the left */
    text-align: left;
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-color);
}

.feature-icon {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--text-color);
}
.feature-card p {
    font-size: 0.95rem;
    color: var(--secondary-text-color);
    margin-bottom: 0;
}

/* --- Responsiveness for the feature grid --- */
@media (max-width: 992px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}
/* ===== END FEATURE SHOWCASE SECTION ===== */

/* ===== PRICING SECTION ===== */
.pricing-section {
    padding: 80px 0;
    background-color: #000; /* A deep black background to highlight the cards */
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.pricing-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* NEW: Add transition for the hover effect */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* NEW: Style for ANY card on hover */
.pricing-card:hover {
    transform: translateY(-8px); /* Lifts the card up */
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); /* Golden glow */
}

.pricing-card.popular {
    border-color: var(--primary-color);
}

.popular-badge {
    position: absolute;
    top: 15px;
    right: -45px;
    background: var(--primary-color);
    color: #1a1a1a;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-weight: 600;
    font-size: 0.8rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
}
.pricing-header p {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    min-height: 40px; /* Align heights */
}

.pricing-price {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--text-color);
}
.pricing-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--secondary-text-color);
}

.pricing-tokens {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 25px;
}
.bonus-badge {
    display: inline-block;
    background: var(--primary-color-hover);
    color: #1a1a1a;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.pricing-features {
    list-style: none;
    margin-bottom: 30px;
    flex-grow: 1; /* Pushes button to the bottom */
}
.pricing-features li {
    margin-bottom: 10px;
    color: var(--secondary-text-color);
}
.pricing-card .cta-button {
    width: 100%;
}

/* --- Responsive Pricing --- */
@media(max-width: 992px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== END PRICING SECTION ===== */

/* ===== GENERATE BUTTON - LOADING STATE ===== */

/* Make the button relative to position the spinner inside */
.generate-arrow-btn {
    position: relative;
}

/* The spinner element */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.2); /* Semi-transparent black border */
    border-top-color: #1a1a1a; /* Opaque black for the moving part */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute; /* Positioned in the center of the button */
    top: 50%;
    left: 50%;
    margin-top: -10px; /* (height/2) */
    margin-left: -10px; /* (width/2) */
    display: none; /* Hidden by default */
}

/* The spin animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* When the button is in the loading state... */
.generate-arrow-btn.is-loading .spinner {
    display: block; /* ...show the spinner. */
}
.generate-arrow-btn.is-loading svg {
    visibility: hidden; /* ...and hide the arrow icon. */
}
.generate-arrow-btn.is-loading {
    cursor: wait; /* Show a waiting cursor */
}
/* ===== END GENERATE BUTTON - LOADING STATE ===== */

/* ===== GENERIC TEXT CONTENT PAGES (ABOUT, FAQ, ETC.) ===== */
.text-content-section {
    padding: 140px 0 80px 0; /* Extra top padding for the transparent header */
}

.text-content-container {
    max-width: 800px; /* Optimal width for reading text */
    margin: 0 auto;
}

.text-content-container h1 {
    font-size: 3rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 25px;
}

.page-lead {
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 40px;
}

.divider {
    height: 1px;
    width: 100px;
    background-color: var(--border-color);
    margin: 0 auto 40px auto;
}

.text-content-container p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.page-tagline {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary-color);
    margin-top: 40px;
}
/* ===== END GENERIC TEXT CONTENT PAGES (ABOUT, FAQ, ETC.) ===== */

/* ===== FAQ ACCORDION ===== */
.faq-accordion {
    width: 100%;
    margin-top: 40px;
}
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 20px 10px;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    padding-right: 40px; /* Space for the icon */
    transition: background-color 0.3s;
}
.faq-question:hover {
    background-color: var(--surface-color);
}

/* The + / - icon */
.faq-question::after {
    content: '+';
    font-family: monospace;
    font-size: 1.5rem;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease, color 0.3s;
}
.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg); /* Rotates to an 'x' */
    color: var(--primary-color);
}
.faq-item.active .faq-question {
    color: var(--primary-color); /* Highlight the active question */
}


/* The animation wrapper */
.faq-answer-content {
    display: grid;
    grid-template-rows: 0fr; /* Collapsed by default */
    overflow: hidden;
    transition: grid-template-rows 0.3s ease-out;
}
.faq-item.active .faq-answer-content {
    grid-template-rows: 1fr; /* Expanded when active */
}

/* The content holder */
.faq-answer {
    /* This element must have no vertical padding/margin itself */
    min-height: 0;
}

/* THE FIX: Apply padding and reset margin ONLY on the <p> inside */
.faq-answer p {
    padding: 0px 10px 20px 10px; /* Padding applied here */
    margin: 0; /* Explicitly remove any global margin */
    color: var(--secondary-text-color);
    line-height: 1.7;
}
/* ===== END FAQ ACCORDION ===== */

/* ===== CLIENTS PAGE ===== */
.clients-section {
    padding: 0 0 80px 0; /* No top padding, as it follows the intro text */
}
.clients-subtitle {
    text-align: center;
    font-size: 1.5rem;
    color: var(--secondary-text-color);
    margin: 40px 0 30px 0;
}
.logos-grid {
    display: grid;
    /* Create an adaptive grid with a minimum item width of 150px */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 25px;
    align-items: center;
}
.logo-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    height: 100px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: transform 0.3s ease, background-color 0.3s;
}
.logo-card:hover {
    transform: translateY(-5px);
    background-color: var(--background-color);
}
.logo-card img {
    max-width: 100%;
    max-height: 50px;
    /* Convert colored logos to monochrome and make them less bright */
    filter: brightness(0) invert(1) grayscale(1);
    opacity: 0.6;
    transition: opacity 0.3s ease, filter 0.3s;
}
.logo-card:hover img {
    opacity: 1;
    /* On hover, logos regain their color (if they were colored) */
    filter: none;
}
/* ===== END CLIENTS PAGE ===== */

/* ===== CONTACT PAGE - DETAILS GRID (CORRECTED) ===== */

.contact-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
}

.contact-detail-card {
    background-color: var(--surface-color);
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    /* THE FIX #1: Added text-align: center; to center all content */
    text-align: center; 
}

.contact-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background-color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

/* THE FIX #2: Explicitly set the SVG colors to inherit the parent's color */
.contact-icon svg {
    stroke: currentColor; 
    fill: currentColor;
}


.contact-detail-card h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}
.contact-detail-card p {
    color: var(--secondary-text-color);
    font-size: 0.95rem;
    min-height: 40px; /* Align heights */
}
.contact-detail-card a {
    font-weight: 600;
    font-size: 1.1rem;
}
.contact-detail-card span {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* Responsive adjustments for contact cards */
@media(max-width: 992px){
    .contact-details-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== END CONTACT PAGE - DETAILS GRID ===== */