/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Remove smooth scrolling for better performance */
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000; /* Next.js Black */
    color: #E0E0E0; /* Light gray for text */
    line-height: 1.6;
    overflow: hidden; /* Prevent body scroll */
    font-size: 14px;
    font-weight: 400;
    height: 100vh; /* Full viewport height */
}

/* Header */
.header {
    background-color: rgba(0, 0, 0, 0.7); /* Translucent black */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle white border */
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Credits */
.header-credits {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    transition: all 0.2s ease;
}

.header-credits .credits-icon {
    font-size: 1rem;
    color: #FFD700;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
}

.credits-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.header-credits .credits-count {
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1;
}

.header-credits .credits-label {
    font-size: 0.75rem;
    color: #A0A0A0;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-credits:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.logo-icon {
    height: 42px;
    width: 42px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.25rem; /* Explicitly set font size */
    font-weight: 600;
    color: #FFFFFF;
}

.logo-link {
    text-decoration: none;
}

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

.nav-link {
    color: #A0A0A0; /* Lighter gray for nav links */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: #FFFFFF;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: #FFFFFF; /* White underline for Next.js style */
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.button-cta {
    background: linear-gradient(to right, #007AFF, #00C2FF);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.button-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.button-cta.icon-btn {
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #B0B0B0;
    box-shadow: none;
}

.button-cta.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    transform: none;
    box-shadow: none;
}

/* Main Container */
.main-container {
    display: flex;
    padding-top: 64px; /* Account for fixed header */
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent container scroll */
}

/* Sidebar */
.sidebar {
    width: 400px;
    background-color: rgba(10, 10, 10, 0.5); /* Slightly lighter translucent black */
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    overflow-y: auto; /* Independent scroll for sidebar */
    overflow-x: hidden;
    height: calc(100vh - 64px); /* Full height minus header */
    position: relative; /* Changed from fixed to relative */
    flex-shrink: 0; /* Prevent shrinking */
    /* Add flex properties for consistent spacing */
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    /* Enhanced scrolling performance */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
}

.credits-section {
    margin-bottom: 1.5rem;
}

.credits-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E0E0E0;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.875rem;
}

.credits-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.credits-icon {
    font-size: 1.125rem;
    color: #FFD700; /* Keep gold for accent */
    filter: none;
}

.credits-label {
    color: #A0A0A0;
    font-weight: 500;
}

.credits-count {
    font-size: 1.25rem; /* Slightly smaller */
    font-weight: 600;
    color: #FFFFFF;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

/* Section Styles */
.section {
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.section-header h3 {
    font-size: 0.875rem;
    font-weight: 500; /* Lighter weight for Next.js style */
    color: #B0B0B0;
    letter-spacing: normal;
}

/* Upload Areas */
.upload-area {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area.success {
    padding: 0; /* Remove padding when showing reference */
    border: 1px solid rgba(56, 189, 137, 0.5);
    background: rgba(56, 189, 137, 0.05);
}

.upload-area::before {
    content: none;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    transform: none;
}

.upload-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: #888888;
    filter: none;
    position: relative;
    display: inline-block;
    min-height: 1.8rem;
}

.upload-area.success .upload-icon {
    width: 100%;
    height: 100%;
    margin: 0;
    font-size: inherit;
}

.upload-text {
    color: #A0A0A0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.upload-text strong {
    color: #E0E0E0;
    font-weight: 500;
}

/* URL Input Container */
.url-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    /* Safari flexbox fixes */
    min-width: 0;
    width: 100%;
}

.url-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #E0E0E0;
    padding: 0.75rem 1rem; /* Slightly smaller padding */
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
    font-weight: 400;
    /* Safari-specific fixes */
    min-width: 0;
    width: 100%;
}

.url-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05); /* More subtle shadow */
}

.url-input::placeholder {
    color: #777777;
    font-weight: 400;
}

.url-fetch-btn {
    background: rgba(255, 255, 255, 0.08); /* Darker button */
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #B0B0B0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Safari-specific fixes */
    flex-shrink: 0;
    min-width: 0;
    max-width: fit-content;
}

.url-fetch-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    transform: none;
}

.fetch-icon {
    font-size: 1rem;
}

/* Form Elements */
.prompt-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #E0E0E0;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    transition: all 0.2s ease;
    font-weight: 400;
    line-height: 1.6;
}

.prompt-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.prompt-input::placeholder {
    color: #777777;
    font-weight: 400;
}

/* Buttons */
.generate-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #A0A0A0;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.generate-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
}

.generate-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.generate-btn:disabled:not(.loading) {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    color: #666666;
    border-color: rgba(255, 255, 255, 0.1);
}

.generate-icon {
    font-size: 1.125rem;
    margin-right: 8px;
}

.custom-style-btn {
    display: none; /* Hide this button */
}

.plus-icon {
    font-size: 1.125rem;
}

/* Main Content */
.content {
    flex: 1;
    padding: 2rem;
    background-color: #000000;
    overflow-y: auto; /* Independent scroll for main content */
    overflow-x: hidden;
    height: calc(100vh - 64px); /* Full height minus header */
    /* Enhanced scrolling performance */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
}

/* Showcase Section */
.showcase-title {
    font-size: 1.75rem; /* Larger title */
    font-weight: 600;
    margin-bottom: 2rem;
    color: #FFFFFF;
    letter-spacing: -0.03em;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 columns */
    gap: 1rem;
    padding-bottom: 3rem;
}

.thumbnail-card {
    background: none;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    aspect-ratio: 16/9; /* YouTube thumbnail aspect ratio */
}

.thumbnail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.thumbnail-card.selected {
    border: 2px solid rgba(56, 189, 137, 0.8);
    box-shadow: 0 0 0 1px rgba(56, 189, 137, 0.3);
}

.thumbnail-card.selected:hover {
    border-color: rgba(56, 189, 137, 1);
    box-shadow: 0 8px 16px rgba(56, 189, 137, 0.2);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #222 0%, #333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 2rem;
    position: relative;
    border-radius: 8px;
}

/* Shimmer Loading Effect for Thumbnails */
.thumbnail-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    z-index: 1;
}

.thumbnail-image img {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.thumbnail-image img.loaded {
    opacity: 1;
}

.thumbnail-overlay {
    display: none; /* Hide category overlays */
}

.thumbnail-info {
    display: none; /* Hide text descriptions */
}

.thumbnail-title {
    display: none;
}

.thumbnail-description {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 350px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on medium screens */
        gap: 0.875rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto; /* Allow body scroll on mobile */
        height: auto; /* Auto height on mobile */
    }
    
    .main-container {
        flex-direction: column;
        height: auto; /* Auto height on mobile */
        overflow: visible; /* Allow overflow on mobile */
        padding-top: 64px; /* Keep header spacing */
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        overflow-y: visible; /* Don't scroll on mobile */
    }
    
    .content {
        padding: 1.5rem;
        height: auto; /* Auto height on mobile */
        overflow-y: visible; /* Don't scroll on mobile */
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .header-credits {
        display: none; /* Hide on mobile to save space */
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 0.75rem;
        padding-bottom: 2rem;
    }
    
    .url-input-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .url-fetch-btn {
        width: 100%;
        justify-content: center;
    }

    .credits-display {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .credits-left {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 0.5rem;
    }
}

/* Enhanced Scrollbar Styling */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading States */
.generate-btn:disabled,
.url-fetch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #A0A0A0 !important; /* Disabled background for white button */
    color: #505050 !important;
    border-color: #A0A0A0 !important;
}

.url-fetch-btn:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #777777 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Upload/Fetch Success States */
.upload-area.success {
    border-color: rgba(56, 189, 137, 0.5); /* Green accent from Next.js */
    background: rgba(56, 189, 137, 0.05);
}

.upload-area.success .upload-icon,
.upload-area.success .upload-text strong {
    color: rgba(56, 189, 137, 1);
}

.url-input.success {
    border-color: rgba(56, 189, 137, 0.5);
    background: rgba(56, 189, 137, 0.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(10, 10, 10, 0.5); /* Lighter, more transparent overlay */
    backdrop-filter: blur(5px); /* Softer blur */
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1f1f1f; /* Dark background for the modal content */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.modal-body {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
}

.modal-body img {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 0;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.download-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.download-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-body img {
        max-height: 50vh;
    }
}

.url-input.success + .url-fetch-btn {
    border-color: rgba(56, 189, 137, 0.3);
    background: rgba(56, 189, 137, 0.1);
    color: rgba(56, 189, 137, 1);
}

.url-fetch-btn.fetching {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #777777 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Enhanced Visual Effects */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modern Loading Animations */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(56, 189, 137, 0.2);
    border-top: 2px solid rgba(56, 189, 137, 1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.loading-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    margin-left: 8px;
}

.loading-dot {
    width: 3px;
    height: 3px;
    background: rgba(56, 189, 137, 0.8);
    border-radius: 50%;
    animation: pulse-dot 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-dot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced Generate Button Loading State */
.generate-btn.loading {
    background: rgba(56, 189, 137, 0.08) !important;
    border-color: rgba(56, 189, 137, 0.25) !important;
    color: rgba(56, 189, 137, 0.9) !important;
    cursor: not-allowed !important;
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
}

.generate-btn.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 137, 0.1), transparent);
    animation: loading-sweep 2s infinite;
    z-index: 1;
}

.generate-btn.loading * {
    position: relative;
    z-index: 2;
}

@keyframes loading-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.upload-area.success {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.05);
}

.url-input.success {
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.05);
}

.error-message {
    color: #FF453A;
    font-size: 0.875rem;
    text-align: center;
    /* Spacing is now applied only when the message is not empty */
}

.error-message:not(:empty) {
    margin-top: 0.5rem;
    min-height: 1.2em; /* Prevent layout shift */
}

.account-info-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.credits-count-sidebar {
    font-weight: 700;
    font-size: 1.2rem;
    color: #FFFFFF;
}

/* Pricing Page Styles */
.pricing-page-main {
    padding: calc(4rem + 64px) 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

body {
    overflow: auto !important;
}

.pricing-hero {
    margin-bottom: 4rem;
}

.pricing-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #FFFFFF; /* White text */
    line-height: 1.2; /* Tighter line height for multi-line */
}

.pricing-subtitle {
    font-size: 1.125rem;
    color: #A0A0A0; /* Light gray */
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.pricing-plans {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap; /* Added for responsiveness */
}

.pricing-plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: left;
    width: 350px;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-plan-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.pricing-plan-card.popular {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.08);
}

.popular-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #FFFFFF;
    color: #000000;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-header {
    margin-bottom: 2rem;
    color: #E0E0E0; /* Light gray text */
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 3rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: baseline;
}

.price-period {
    font-size: 1rem;
    font-weight: 400;
    color: #A0A0A0;
    margin-left: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1.5rem;
    font-weight: 400;
    margin-right: 0.5rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #E0E0E0; /* Light gray text */
}

.checkmark {
    color: #a0a0a0;
    font-weight: bold;
}

.plan-cta-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.pricing-plan-card.popular .plan-cta-btn {
    background: #FFFFFF;
    color: #000000;
}

.pricing-plan-card.popular .plan-cta-btn:hover {
    background: #f0f0f0;
}

.pricing-plan-card:not(.popular) .plan-cta-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #B0B0B0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pricing-plan-card:not(.popular) .plan-cta-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

/* --- ShadCN Dialog Inspired Modals --- */

/* Image Result Modal */
#imageModal .modal-content {
    max-width: 960px;
    width: 100%;
    padding: 24px;
    background: hsl(0 0% 9%);
    border-radius: 0.75rem;
    border: 1px solid hsl(0 0% 14.9%);
    box-shadow: 0 10px 38px -10px rgba(0, 0, 0, 0.35), 0 10px 20px -15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

#imageModal .modal-header {
    padding: 0;
    border-bottom: none;
    margin-bottom: 16px;
}

#imageModal .modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(0 0% 98%);
    line-height: 1;
}

#imageModal .modal-close {
    color: hsl(0 0% 63.9%);
    transition: color 0.2s ease;
}

#imageModal .modal-close:hover {
    color: hsl(0 0% 98%);
    background: none;
}

#imageModal .modal-body {
    padding: 0;
    margin: 0;
    background: none;
    margin-bottom: 24px;
}

#imageModal .modal-body img {
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0.5rem;
    border: 1px solid hsl(0 0% 14.9%);
    display: block;
}

#imageModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
}

#imageModal .modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#imageModal .modal-btn.primary {
    color: hsl(0 0% 9%);
    background-color: hsl(0 0% 98%);
}

#imageModal .modal-btn.primary:hover {
    background-color: hsl(0 0% 92%);
}

#imageModal .modal-btn.secondary {
    color: hsl(0 0% 98%);
    background-color: hsl(0 0% 14.9%);
    border: 1px solid hsl(0 0% 22%);
}

#imageModal .modal-btn.secondary:hover {
    background-color: hsl(0 0% 20%);
}

/* Error Modal Specifics */
.error-modal-content {
    max-width: 440px;
    padding: 24px;
    text-align: left;
    background: hsl(0 0% 9%); /* Near-black background from the example */
    border-radius: 0.75rem; /* 12px */
    border: 1px solid hsl(0 0% 14.9%); /* Subtle, light border */
    box-shadow: 0 10px 38px -10px rgba(0, 0, 0, 0.35), 0 10px 20px -15px rgba(0, 0, 0, 0.2);
}

.error-modal-header {
    margin-bottom: 8px;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: hsl(0 0% 98%); /* Bright white heading */
    line-height: 1;
}

#errorModalMessage {
    margin: 0 0 24px 0;
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
    color: hsl(0 0% 63.9%); /* Muted gray text */
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

#errorModalOkBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem; /* 8px */
    padding: 10px 16px;
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    color: hsl(0 0% 9%); /* Black text on white button */
    background-color: hsl(0 0% 98%); /* Primary button background */
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

#errorModalOkBtn:hover {
    background-color: hsl(0 0% 92%); /* Slightly dimmer on hover */
}

/* --- Styles for Static Content Pages (Terms, Privacy, etc.) --- */

.page-content, .legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(4rem + 64px); /* Account for fixed header */
    color: #E0E0E0;
}

.page-content h1, .legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
    letter-spacing: -0.03em;
}

.legal-content h1 {
    font-size: 2rem; /* Override for legal pages */
    margin-bottom: 0.5rem;
}

.page-content h2, .legal-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.legal-content h2 {
    font-size: 1.5rem; /* Override for legal pages */
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: none; /* No underline for legal subheadings */
    padding-bottom: 0;
}

.page-content p, .page-content li,
.legal-content p, .legal-content li {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1rem;
}

.page-content a, .legal-content a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.page-content a:hover, .legal-content a:hover {
    text-decoration: underline;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    font-size: 1rem;
    color: #FFFFFF;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Static pages need scrollbars */
.static-page-body {
    overflow: auto;
}

/* --- New Styles for Guide Page --- */

.guide-intro {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.guide-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.guide-intro .subtitle {
    font-size: 1.25rem;
    color: #A0A0A0;
    max-width: 650px;
    margin: 0 auto;
}

.guide-brain-emoji {
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    margin-right: 0.5rem;
}

.guide-welcome {
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    color: #C0C0C0;
}

.guide-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.guide-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emoji-bullet {
    display: inline-block;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.text-highlight {
    color: #FFFFFF;
    font-weight: 600;
}

/* Getting Started Steps */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 3px solid #007AFF;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007AFF;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.step-content h3 {
    margin: 0 0 0.25rem 0;
    color: #FFFFFF;
    font-weight: 600;
}

.step-content p {
    margin: 0;
    color: #A0A0A0;
}

/* Highlight Box (Pro Tip) */
.highlight-box {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(0, 194, 255, 0.1));
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.highlight-content h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #E0E0E0;
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
}

.pro-tip-emoji {
    font-size: 1.5rem;
}

.highlight-content p {
    margin: 0;
    color: #B0C4DE; /* Light steel blue */
}

/* Feature Lists */
.feature-list, .feature-list-small {
    list-style: none;
    padding-left: 0;
    margin-top: 1.5rem;
}

.feature-list > li {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.feature-list > li h4 {
    color: #FFFFFF;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.feature-list > li p {
    color: #A0A0A0;
    margin: 0;
}

.feature-list-small {
    padding-left: 1.5rem;
}

.feature-list-small li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-list-small li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    color: #00C2FF;
    font-weight: bold;
}

/* Callout Section */
.callout-section {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.2);
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.faq-grid .faq-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1.5rem;
}

.faq-grid .faq-item h3 {
    color: #FFFFFF;
    margin-bottom: 0.5rem;
}

.faq-grid .faq-item p {
    color: #A0A0A0;
}

@media (max-width: 768px) {
    .guide-intro h1 {
        font-size: 2rem;
    }
    .guide-section {
        padding: 1.5rem;
    }
    .step-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* --- About Page Styles --- */

.about-intro {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3rem;
}

.about-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #FFFFFF;
}

.about-subtitle {
    font-size: 1.25rem;
    color: #A0A0A0;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

.story-section {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.story-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.story-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    color: #D0D0D0;
}

.story-section em {
    color: #FFFFFF;
    font-style: italic;
}

.story-section strong {
    color: #FFFFFF;
    font-weight: 600;
}

.highlight-stat {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
}

.highlight-stat strong {
    color: #FF6B6B;
}

.transformation-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem 0;
    padding: 2rem;
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
}

.stat-before, .stat-after {
    text-align: center;
    flex: 1;
}

.stat-before h3, .stat-after h3 {
    font-size: 0.9rem;
    color: #A0A0A0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.big-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-before .big-number {
    color: #FF6B6B;
}

.stat-after .big-number {
    color: #00C2FF;
}

.stat-before p, .stat-after p {
    font-size: 0.9rem;
    color: #A0A0A0;
    margin: 0;
}

.stat-arrow {
    font-size: 2rem;
    color: #00C2FF;
    font-weight: bold;
}

.mission-section {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 3rem 0;
}

.mission-statement {
    background: rgba(0, 0, 0, 0.3);
    border-left: 4px solid #FFD700;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.mission-statement p {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.mission-statement p:last-child {
    margin-bottom: 0;
}

.closing-message {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}

.closing-message p:first-child {
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.closing-message p:last-child {
    font-size: 0.95rem;
    color: #A0A0A0;
    font-style: italic;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .about-intro h1 {
        font-size: 2rem;
    }
    
    .transformation-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-arrow {
        transform: rotate(90deg);
    }
    
    .big-number {
        font-size: 2.5rem;
    }
    
    .mission-section {
        padding: 1.5rem;
    }
    
    .story-section {
        padding: 0;
    }
} 