/* Modern Design System with Preserved Chat Preview */

:root {
    /* Refined Color Palette - Modern & Professional */
    --primary: #25D366;
    --primary-dark: #128C7E;
    --primary-light: #E8F8F0;
    --accent: #2563eb;
    /* Use a strong blue for general UI actions */
    --accent-dark: #1e40af;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Typography */
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    /* Shadows & Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* Global Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-dark);
}

.hidden-force,
#pricingSection.hidden-force,
.export-section.hidden-force {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body {
    padding-top: 0;
    /* Adjusted for landing page hero */
}

/* Safe area for sections with fixed navbar */
#previewSection,
#pricingSection,
#exportSection {
    padding-top: 80px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* 
   --------------------------------------------------
   VIEW SPECIFIC STYLES 
   Each section acts as a distinct view/page state
   --------------------------------------------------
*/

/* 1. HERO - Enhanced Upload View */
.hero-section {
    background: radial-gradient(circle at top right, #25D366 0%, #128C7E 100%);
    color: white;
    /* padding is handled inline for specific layout */
    text-align: center;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: 0 4px 20px rgba(18, 140, 126, 0.15);
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.92;
    max-width: 560px;
    margin: 0 auto var(--spacing-lg);
    line-height: 1.5;
    font-weight: 400;
}

/* Modern Upload Card */
.upload-wrapper {
    margin-top: -4.5rem;
    /* Refined overlap */
}

.upload-area {
    background: var(--bg-card);
    border: 2px dashed rgba(37, 211, 102, 0.3);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.upload-area:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.2);
}

.upload-icon {
    width: 90px;
    height: 90px;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: var(--spacing-lg);
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
}

.upload-button {
    background: var(--primary);
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition);
    margin-top: var(--spacing-md);
    letter-spacing: 0.5px;
}

.upload-button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.4);
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light) !important;
}

/* 2. PREVIEW SECTION - Dashboard View */
.preview-section {
    display: none;
    /* Initially hidden */
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.preview-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Processing Section Active State (if using class) */
.view-container.active {
    display: block !important;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    /* Sidebar + Chat */
    gap: var(--spacing-xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Stats & Controls */
.dashboard-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 2rem;
}

.stats-card {
    background: var(--bg-main);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.stats-card h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* 3. DOWNLOAD / EXPORT SECTION */
.export-section {
    display: none;
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
}

.export-section.active {
    display: block;
    animation: slideUp 0.5s ease-out;
}

.pricing-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* Modern Card Style for Pricing/Export */
.export-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.export-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.export-card.popular {
    border: 2px solid var(--primary);
    background: linear-gradient(to bottom, var(--bg-card), var(--primary-light));
}

.export-card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.export-card-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.export-btn {
    width: 100%;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-top: var(--spacing-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-solid {
    background: var(--primary);
    color: white;
}

.btn-solid:hover {
    background: var(--primary-dark);
}


/* 
   --------------------------------------------------
   PRESERVED CHAT PREVIEW CSS 
   Must remain functionally identical to WhatsApp web 
   --------------------------------------------------
*/

.chat-preview-container {
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%23d1d7db' fill-opacity='0.1'/%3E%3C/svg%3E");
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    height: 900px;
    /* Increased height to match stats sidebar */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* The actual scrollable area */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

/* Original Message Styles - UNCHANGED - Enhanced logic for Bengali support */
.message {
    margin-bottom: 2px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-card {
    max-width: 85%;
    padding: 6px 7px 8px 9px;
    /* Slightly adjusted padding */
    border-radius: 7.5px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    margin-bottom: 2px;
    background-color: #ffffff;
    align-self: flex-start;
    font-family: inherit;
    /* Inherit global font or set specifically if needed */
}

.message-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 8px;
    height: 13px;
    background-color: inherit;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.message.own-message {
    align-items: flex-end;
}

.message.own-message .message-card {
    background-color: #d9fdd3;
    align-self: flex-end;
}

.message.own-message .message-card::before {
    left: auto;
    right: -8px;
    transform: scaleX(-1);
}

.system-message .message-card {
    background-color: rgba(255, 245, 196, 0.9);
    /* Slightly more opaque */
    max-width: 60%;
    margin: 8px auto;
    text-align: center;
    border-radius: 8px;
    font-size: 12.5px;
    color: #54656f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.system-message .message-card::before {
    display: none;
}

.message-content {
    font-size: 14.2px;
    /* Authentic WhatsApp web size */
    line-height: 19px;
    color: #111b21;
    margin-right: 0;
    /* Let flex handle spacing */
    padding-bottom: 4px;
    /* Space for time */
    word-wrap: break-word;
}

.sender-name {
    font-size: 12.8px;
    font-weight: 500;
    color: var(--primary-dark);
    /* Using theme variable but keeping intent */
    margin-bottom: 4px;
    line-height: 1.4;
}

.message.own-message .sender-name {
    display: none;
}

.timestamp {
    font-size: 11px;
    color: #667781;
    margin-left: 4px;
    float: right;
    margin-top: 4px;
    /* Push to bottom right */
    position: relative;
    top: 2px;
}

.date-divider {
    text-align: center;
    margin: 12px 0;
    position: sticky;
    top: 10px;
    /* Enhance UX by sticking while scrolling past */
    z-index: 5;
}

.date-divider span {
    background-color: #ffffff;
    /* Cleaner than light blue */
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #54656f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Media Styles - Preserved */
.media-preview {
    margin-bottom: 4px;
    border-radius: 6px;
    overflow: hidden;
    max-width: 300px;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    max-height: 300px;
    object-fit: cover;
    cursor: pointer;
}

/* Modals */
.modal-overlay,
.export-modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    /* Modern blur effect */
}

.export-modal.active,
.modal-overlay.active {
    display: flex !important;
    animation: fadeIn 0.3s ease-out forwards;
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

/* 
   --------------------------------------------------
   MISSING MODAL FORM STYLES 
   Restoring full feature look
   --------------------------------------------------
*/

.export-options-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 
   --------------------------------------------------
   MOBILE HERO & RESPONSIVE FIXES 
   --------------------------------------------------
*/

.hero-navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 10;
}

.hero-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-logo {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-nav-links {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    gap: 1.5rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    /* Navbar Stacking */
    .hero-navbar {
        padding: 1.5rem 0;
        /* Keep absolute so it overlays the green background */
        position: absolute;
    }

    .hero-nav-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Hero Content */
    .hero-section {
        /* Increased padding to accommodate stacked navbar */
        padding-top: 8rem !important;
        padding-bottom: 3rem !important;
    }

    .hero-title {
        font-size: 2rem !important;
        /* Smaller on mobile */
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }

    /* Trust Badges - Stack or wrapped */
    .trust-badges {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem !important;
        padding: 0.5rem 1rem !important;
        border-radius: 20px !important;
    }

    /* Upload Wrapper Overlap */
    .upload-wrapper {
        margin-top: -3rem !important;
        /* Less overlap */
    }

    .upload-area {
        padding: 2rem 1rem !important;
    }

    .upload-icon {
        width: 70px !important;
        height: 70px !important;
        font-size: 2rem !important;
    }

    .upload-button {
        width: 100%;
        /* Full width button on mobile */
    }
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #fff;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

.modal-actions {
    margin-top: var(--spacing-xl);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.form-message {
    font-size: 0.9rem;
    /* Space for time */
    word-wrap: break-word;
}

.sender-name {
    font-size: 12.8px;
    font-weight: 500;
    color: var(--primary-dark);
    /* Using theme variable but keeping intent */
    margin-bottom: 4px;
    line-height: 1.4;
}

.message.own-message .sender-name {
    display: none;
}

.timestamp {
    font-size: 11px;
    color: #667781;
    margin-left: 4px;
    float: right;
    margin-top: 4px;
    /* Push to bottom right */
    position: relative;
    top: 2px;
}

.date-divider {
    text-align: center;
    margin: 12px 0;
    position: sticky;
    top: 10px;
    /* Enhance UX by sticking while scrolling past */
    z-index: 5;
}

.date-divider span {
    background-color: #ffffff;
    /* Cleaner than light blue */
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #54656f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Media Styles - Preserved */
.media-preview {
    margin-bottom: 4px;
    border-radius: 6px;
    overflow: hidden;
    max-width: 300px;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    max-height: 300px;
    object-fit: cover;
    cursor: pointer;
}

/* Modals */
.modal-overlay,
.export-modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    /* Modern blur effect */
}

.export-modal.active,
.modal-overlay.active {
    display: flex !important;
    animation: fadeIn 0.3s ease-out forwards;
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

/* 
   --------------------------------------------------
   MISSING MODAL FORM STYLES 
   Restoring full feature look
   --------------------------------------------------
*/

.export-options-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-select,
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #fff;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

.modal-actions {
    margin-top: var(--spacing-xl);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.form-message {
    font-size: 0.9rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
}

.form-message.error {
    background: #fee2e2;
    color: #b91c1c;
}

/* 8. PROCESSING SECTION - Professional Loading */
#processingSection {
    display: flex;
    align-items: center;
    justify-content: center;
}

#processingSection .processing-card {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 9. MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .dashboard-sidebar {
        position: relative !important;
        top: 0 !important;
    }

    .hero-title {
        font-size: 2rem !important;
        padding: 0 1rem;
        /* Prevent edge touching */
    }

    .hero-subtitle {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    /* Fix Trust Badges on Mobile */
    .trust-badges {
        flex-direction: row !important;
        /* Keep in row but wrap */
        flex-wrap: wrap;
        gap: 0.75rem !important;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .trust-badges>div {
        background: rgba(255, 255, 255, 0.15);
        padding: 0.4rem 0.8rem;
        border-radius: 20px;
    }

    .container {
        padding: 0 1rem !important;
    }

    .processing-card {
        padding: 2rem 1.5rem !important;
        width: 95% !important;
    }

    .hidden-mobile {
        display: none !important;
    }

    /* Upload Wrapper Adjustment */
    .upload-wrapper {
        margin-top: -3rem;
        /* Less negative margin on mobile */
        padding: 0 1rem;
    }

    .upload-area {
        padding: 2rem 1.5rem;
    }

    /* Preview Section Mobile Fixes */
    .dashboard-layout {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .chat-preview-container {
        height: 60vh !important;
        /* Limit height on mobile to avoiding huge scroll */
        min-height: 400px;
    }

    .message-card {
        max-width: 90% !important;
        /* Use more width on small screens */
    }

    /* Ensure Sidebar comes first or second? 
       Actually standard sticking is fine, but maybe reduce padding */
    .dashboard-sidebar {
        padding: 1rem !important;
    }

    .stats-card,
    .export-card {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {

    /* Hide Nav Links on very small screens to save space for Logo */
    .nav-links {
        display: none !important;
    }

    .logo {
        font-size: 1.25rem !important;
    }

    /* Center the logo since links are gone */
    #uploadSection nav .container {
        justify-content: center !important;
    }

    #processingPercentage {
        font-size: 1.75rem !important;
    }

    .circular-progress-container {
        width: 120px !important;
        height: 120px !important;
    }

    #messageCount {
        font-size: 2rem !important;
    }

    .hero-title {
        font-size: 1.75rem !important;
    }
}

/* 
   --------------------------------------------------
   GLASSMORPHIC AUTH MODALS - Modern Design
   --------------------------------------------------
*/

/* Modal Overlay with Enhanced Blur */
.export-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.export-modal.active {
    display: flex !important;
}

/* Glassmorphic Modal Content */
.auth-modal-content,
.export-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.auth-modal-content h3,
.export-modal-content h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Close Button */
.close-btn-absolute {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn-absolute:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    transform: rotate(90deg);
}

/* Form Styling - Modern & Clean */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: white;
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* Modern Buttons */
.btn {
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #F3F4F6;
    color: #374151;
    border: 2px solid #E5E7EB;
}

.btn-secondary:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

/* Helper Text */
.helper-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6B7280;
}

.helper-text a {
    color: #10B981;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.helper-text a:hover {
    color: #059669;
    text-decoration: underline;
}

/* Loading State for Buttons */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading {
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 640px) {

    .auth-modal-content,
    .export-modal-content {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }

    .auth-modal-content h3,
    .export-modal-content h3 {
        font-size: 1.5rem;
    }
}

/* Subtle Gradient Background for Modals */
.export-modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 
   --------------------------------------------------
   PROFILE PAGE STYLES (SPA Integration)
   --------------------------------------------------
*/
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-header {
    background: radial-gradient(circle at top right, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.2);
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.profile-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.file-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    border-left: 4px solid #10B981;
}

.file-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-premium {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    color: white;
}

.badge-success {
    background: #10B981;
    color: white;
}

.badge-pending {
    background: #F59E0B;
    color: white;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.feature-list li::before {
    content: "✓";
    color: #10B981;
    font-weight: 700;
}

.btn-download {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

.payment-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}

.payment-table th {
    text-align: left;
    padding: 0.75rem;
    background: #F9FAFB;
    border-bottom: 2px solid #E5E7EB;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.payment-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9CA3AF;
}

.empty-state-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #6B7280;
}

.spinner {
    border: 4px solid #E5E7EB;
    border-top: 4px solid #10B981;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #374151;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

/* Homepage Content Styles */
.section-container {
    padding: 0 1rem;
}

/* Homepage Content Styles */
.section-container {
    padding: 0 1rem;
}

.steps-grid {
    margin-top: 3rem;
    gap: 2rem;
}

.step-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.step-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #E8F8F0 0%, #D1FAE5 100%);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(18, 140, 126, 0.1);
}

.step-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.check-list {
    list-style: none;
    padding: 0;
}

.check-list li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.75rem;
    color: var(--text-secondary);
}

.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
}

.privacy-grid .feature-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    padding: 2.5rem 2rem !important;
    transition: all 0.3s ease;
}

.privacy-grid .feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.privacy-grid .feature-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.privacy-grid .feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.privacy-grid {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .content-split {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .privacy-grid {
        grid-template-columns: 1fr !important;
    }
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light) !important;
}

/* 
   --------------------------------------------------
   COMPARISON SECTION STYLES 
   Before & After View
   --------------------------------------------------
*/

.comparison-section {
    padding: var(--spacing-2xl) 0;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.comparison-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.comparison-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.comparison-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: stretch;
}

@media (max-width: 900px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

/* Common Card Styles for Comparison */
.comparison-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    /* Fixed height for scrolling */
    border: 1px solid var(--border);
}

.comparison-card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.badge-before {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-after {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Before View (Text/Terminal) */
.before-view-content {
    flex: 1;
    background: #f5f5f5;
    /* Light grey for text file look */
    padding: var(--spacing-lg);
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

/* After View (Chat) */
.after-view-content {
    flex: 1;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='%23d1d7db' fill-opacity='0.1'/%3E%3C/svg%3E");
    padding: var(--spacing-md);
    overflow-y: auto;
    /* Reusing message styles from main app */
}

/* Ensure messages in comparison look exactly like main app */
.after-view-content .message-card {
    max-width: 90%;
    /* Slightly wider for the smaller container context */
}

/* Hide scrollbar aesthetics */
.before-view-content::-webkit-scrollbar,
.after-view-content::-webkit-scrollbar {
    width: 6px;
}

.before-view-content::-webkit-scrollbar-thumb,
.after-view-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}