/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Prevent flash of feature-flagged elements before JS initializes.
   Pages add the `ff-locked` class to the root element early; when
   feature flag code runs it should remove this class. */
:root.ff-locked [data-feature],
html.ff-locked [data-feature],
body.ff-locked [data-feature] {
    display: none !important;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-text {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Custom styles for the Test Generator homepage */
:root {
    --primary-color: #10a37f;
    /* control sizing for the input box controls */
        /* control sizing for the input box controls (tunable) */
        --input-controls-height: 72px; /* default for medium screens */
        --input-controls-padding: 12px; /* breathing room between textarea and controls */
    --secondary-color: #1a7f64;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #374151;
    --border-color: #e5e7eb;
    /* Loader logo sizing (desktop, mobile) */
    --loader-logo-size: 144px;
    --loader-logo-size-mobile: 108px;
}

body {
    background: #ffffff;
    /* Use flexible layout so footer can be pushed to bottom on short pages
       and sit after content on long pages. Allow scrolling. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-color) !important;
}

.navbar-brand i {
    color: var(--primary-color);
    margin-right: 8px;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* allow visible overflow on narrow/medium screens so controls and shadows aren't clipped */
    overflow: visible;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Upload Container */
.upload-container {
    max-width: 768px;
    margin: 0 auto;
}

/* OpenAI-style input container */
.openai-input-container {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.openai-input-box {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 120px; /* Increased height to match chat.z.ai */
    width: 100%;
    max-width: 800px; /* Match the width from the screenshot */
    margin: 0 auto;
}

.openai-input-box:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.openai-input-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.input-content {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 120px; /* Increased height to match chat.z.ai */
    padding-bottom: 50px; /* Extra space for option buttons at bottom */
}

.input-actions {
    position: absolute;
    bottom: 3.6px; /* Reduced by 70% from 12px */
    right: 0px; /* Move to rightmost edge */
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Model select styling in input actions */
#modelSelect {
    font-size: 0.56rem !important;            /* Match option button font size */
    padding: 4.2px 8.4px !important;        /* Match option button padding */
    height: auto !important;                  /* avoid fixed tall control */
    line-height: 1.2 !important;             /* slightly increased line height */
    border: 1px solid #e5e7eb; /* Match option button border */
    background: white; /* Match option button background */
    min-height: 28px;                         /* Match option button height */
    width: var(--model-select-width, fit-content) !important;            /* Dynamic width via CSS variable */
    min-width: 120px !important;             /* Minimum width for shorter text */
    max-width: 200px !important;             /* Maximum width to prevent overflow */
    border-radius: 11.2px !important;             /* Match option button border radius */
    font-weight: bold !important;             /* Make text bold */
    white-space: nowrap;                      /* Prevent text wrapping */
    overflow: visible;                        /* Allow text to be fully visible */
    display: inline-block;                    /* Ensure proper sizing */
    box-sizing: border-box;                   /* Include padding in width calculation */
}

/* Mobile override for better touch targets */
@media (max-width: 575.98px) {
    #modelSelect {
        min-height: 28px !important;          /* Match option button height on mobile */
        font-size: 0.56rem !important;         /* Match option button font size */
        padding: 4.2px 8.4px !important;   /* Match option button padding */
        width: var(--model-select-width, fit-content) !important;         /* Dynamic width via CSS variable on mobile */
        min-width: 120px !important;             /* Maintain min-width for full text */
        max-width: 200px !important;             /* Maximum width to prevent overflow */
        font-weight: bold !important;             /* Make text bold on mobile */
        white-space: nowrap;                      /* Prevent text wrapping on mobile */
        overflow: visible;                        /* Allow text to be fully visible on mobile */
    }
}

.attach-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 28px; /* Increased to match option buttons */
    height: 28px; /* Increased to match option buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb; /* Add border to match option buttons */
    background: white; /* Add background to match option buttons */
}

.attach-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.attach-btn i {
    font-size: 8.4px; /* Match option button icon size */
}

/* Generation Options Inside Text Box */
.generation-options-inside {
    position: absolute;
    bottom: 3.6px; /* Reduced by 70% from 12px */
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-btn-inside {
    padding: 4.2px 8.4px;                          /* reduced by 30% from 6px 12px */
    font-size: 0.56rem;                          /* reduced by 30% from 0.8rem */
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 11.2px;                         /* reduced by 30% from 16px */
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4.2px;                                   /* reduced by 30% from 6px */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.option-btn-inside:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.option-btn-inside.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.option-btn-inside.active:hover {
    background: #059669;
    border-color: #059669;
}

.option-btn-inside i {
    font-size: 8.4px;                             /* reduced by 30% from 12px */
}

.openai-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background: transparent;
    min-height: 60px;
    max-height: 400px;
    overflow-y: auto;
    font-family: inherit;
    /* Reserve bottom space dynamically based on control size */
    padding: 16px 16px calc(var(--input-controls-height) + var(--input-controls-padding)) 16px;
}

.openai-textarea::placeholder {
    color: #9ca3af;
}

.openai-send-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.openai-send-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.openai-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.openai-send-btn svg {
    width: 16px;
    height: 16px;
}

/* File upload area (hidden by default) */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 1rem;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #f8fffe;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: #f0fdfa;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.upload-content h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.selected-file, .url-analysis {
    background: #f8fffe;
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
}

.file-info, .url-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Generation Options */
.generation-options {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.options-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.option-btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.option-btn:hover {
    border-color: #9ca3af;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.option-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.option-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.option-btn.active:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.option-btn i {
    font-size: 0.9rem;
}

/* Selected Files Display */
.selected-files {
    margin-top: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-type {
    font-size: 12px;
    color: #10a37f;
    font-weight: 500;
    text-transform: uppercase;
}

.remove-file-btn {
    background: #ef4444;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.remove-file-btn i {
    font-size: 12px;
}


/* Main Action Buttons */
.main-action-buttons {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.main-action-btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
    min-width: 200px;
    justify-content: center;
}

.main-action-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.4);
}

.main-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.3);
}

.main-action-btn.secondary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-action-btn.secondary:hover {
    background: #f8fffe;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Features Section */
.features-section {
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}

.feature-card {
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.feature-card h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #6b7280;
    margin: 0;
}

.auth-form {
    margin-top: 2rem;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
}

.subscription-status {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.status-active {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.status-inactive {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.status-expired {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeaa7;
    color: #856404;
}

.subscription-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.subscription-details {
    flex: 1;
}

.subscription-actions {
    display: flex;
    gap: 10px;
}

.pricing-card {
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

.pricing-card.featured {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.pricing-card.featured::before {
    content: "Most Popular";
    position: absolute;
    top: 0;
    right: 0;
    background: var(--success-color);
    color: white;
    padding: 5px 15px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 0 15px 0 10px;
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.price-period {
    font-size: 1rem;
    color: #6c757d;
}

.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li i {
    color: var(--success-color);
    margin-right: 10px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.extension-download {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-top: 2rem;
}

.extension-download h3 {
    margin-bottom: 1rem;
}

.extension-download p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.download-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--primary-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .subscription-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subscription-actions {
        width: 100%;
        margin-top: 1rem;
    }
    
    .subscription-actions .btn {
        flex: 1;
    }
    
    .usage-stats {
        grid-template-columns: 1fr;
    }
}

/* Mid-size responsiveness (phones & small tablets) */
@media (max-width: 800px) {
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        padding: 0 8px;
    }

    .upload-container {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .openai-input-box {
        max-width: 640px;
        width: 100%;
        padding: 14px;
        min-height: 110px;
    }

    /* Reduce main action buttons size so they fit on smaller widths */
    .main-action-btn {
        min-width: 140px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .main-action-btn.secondary {
        min-width: 140px;
    }

    /* Allow the hero section to expand vertically without clipping */
    .hero-section {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* Ensure footer fits under content */
    body { min-height: 100vh; }
}

/* Responsive tuning for input control sizing */
@media (max-width: 420px) {
    /* Very small phones: tighter controls to preserve text area */
    :root {
        --input-controls-height: 56px;
        --input-controls-padding: 10px;
    }
}

@media (min-width: 421px) and (max-width: 575.98px) {
    /* Small phones: a bit more breathing room */
    :root {
        --input-controls-height: 64px;
        --input-controls-padding: 12px;
    }
}

@media (min-width: 576px) and (max-width: 1024px) {
    /* Tablets and larger phones */
    :root {
        --input-controls-height: 76px;
        --input-controls-padding: 14px;
    }
}

@media (min-width: 1025px) {
    /* Desktop: slightly larger controls if needed */
    :root {
        --input-controls-height: 80px;
        --input-controls-padding: 14px;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: #ffffff !important;
}

/* Navbar Visibility Control */
#authLinks {
    display: flex !important;
}

#userProfile {
    display: none !important;
}

#authLinks.hidden {
    display: none !important;
}

#userProfile.visible {
    display: flex !important;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    color: #6b7280 !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* User Profile Styles */
#userProfile {
    gap: 0.75rem;
}

#upgradeBtn {
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

#upgradeBtn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

#freeBadge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

#profileDropdown {
    background: none;
    border: none;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

#profileDropdown:hover {
    color: var(--primary-color);
}

#profileDropdown:hover .text-dark {
    color: var(--primary-color) !important;
}

#profileDropdown:focus {
    box-shadow: none;
}

#userAvatar {
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s ease;
}

#profileDropdown:hover #userAvatar {
    border-color: var(--primary-color);
}

#userName {
    font-weight: 500;
    color: #374151;
}

/* Pricing Modal Styles */
#pricingPlansModal .card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

#pricingPlansModal .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#pricingPlansModal .card.border-primary {
    border-width: 3px !important;
}

#pricingPlansModal .badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
}

#pricingPlansModal .display-6 {
    font-size: 2.5rem;
    font-weight: 700;
}

#pricingPlansModal .list-unstyled li {
    padding: 0.25rem 0;
}

#pricingPlansModal .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

#pricingPlansModal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* AI Loading Overlay Styles */
.ai-loading-modal {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.ai-loading-modal .modal-body {
    padding: 3rem 2rem;
    background: transparent;
}

.flask-logo-container {
    margin-bottom: 2rem;
}

.flask-logo {
    /* Use the same in-place rotation + subtle glow as navbar for consistency */
    animation: flask-spin 1.6s linear infinite, flask-glow 2.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

.flask-logo svg {
    transition: transform 0.3s ease;
}

/* Unified site loader styles */
.site-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.site-loader .flask-logo,
.site-loader .flask-logo-small {
    width: auto;
    height: auto;
    will-change: transform, opacity;
}

.site-loader .loading-message {
    color: #0f1724; /* dark text */
    font-weight: 600;
    font-size: 14px;
}

/* Spinner animation */
@keyframes flask-spin {
    0% { transform: rotate(0deg) scale(1); }
    40% { transform: rotate(160deg) scale(1.02); }
    60% { transform: rotate(200deg) scale(0.98); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes flask-glow {
    0% { filter: drop-shadow(0 0 0 rgba(109,40,217,0.0)); }
    50% { filter: drop-shadow(0 6px 18px rgba(13,110,253,0.18)); }
    100% { filter: drop-shadow(0 0 0 rgba(109,40,217,0.0)); }
}

/* When a site-wide loading state is active, animate the navbar logo */
body.site-loading .navbar-brand .fa-flask,
body.site-loading .navbar-brand .flask-logo {
    animation: flask-spin 1.6s linear infinite, flask-glow 2.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

/* Animate overlay flask icons with exact same animation as navbar */
.site-loader-logo .fa-flask,
.site-loader-logo .flask-logo {
    animation: flask-spin 1.6s linear infinite, flask-glow 2.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

/* Make sure loader content is centered in modals */
.ai-loading-modal .modal-body { padding: 28px 20px; }

/* Ensure loading message in AI modals remains visible on dark backdrops */
.ai-loading-modal .loading-message {
    color: #ffffff;
}

.ai-output-single {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    animation: fadeInOut 0.8s ease-in-out forwards;
}

/* Loading screen text should always be visible */
.loading-output {
    opacity: 1 !important;
    animation: none !important;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    margin-top: 1rem;
}

.ai-prompt {
    color: #ffffff;
}

.ai-prompt.thinking {
    color: #ffffff;
    font-style: italic;
}

.ai-prompt.processing {
    color: #ffffff;
    font-weight: 500;
}

.ai-prompt.success {
    color: #ffffff;
    font-weight: 500;
}

.ai-prompt.error {
    color: #ffffff;
    font-weight: 500;
}

.ai-prompt.warning {
    color: #ffffff;
    font-weight: 500;
}

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

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(13, 110, 253, 0.3));
    }
    50% {
        filter: drop-shadow(0 4px 12px rgba(13, 110, 253, 0.6));
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Small inline flask (compact spinner) */
.flask-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    color: var(--primary-color);
}
.flask-inline i,
.flask-inline .flask-inline-clone,
.flask-inline svg {
    display: inline-block;
    line-height: 1;
    width: 1rem;
    height: 1rem;
}
.flask-inline-sm i,
.flask-inline-sm .flask-inline-clone,
.flask-inline-sm svg {
    width: 0.9rem;
    height: 0.9rem;
    font-size: 0.9rem;
}
.flask-inline-md i,
.flask-inline-md .flask-inline-clone,
.flask-inline-md svg {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
}
.flask-inline-lg i,
.flask-inline-lg .flask-inline-clone,
.flask-inline-lg svg {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1.6rem;
}
.flask-inline i,
.flask-inline .flask-inline-clone {
    animation: flask-spin 1.2s linear infinite, flask-glow 2s ease-in-out infinite;
    transform-origin: 50% 50%;
}

/* Test Scenarios and Automated Tests Modal Styles */
#testScenariosModal .modal-dialog,
#automatedTestsModal .modal-dialog {
    max-width: 95vw;
}

#testScenariosModal .modal-body,
#automatedTestsModal .modal-body {
    padding: 1.5rem;
}

/* Live Test Modal Styles */
#liveTestModal .modal-body {
    padding: 1.5rem;
}

#liveTestModal input[type="url"] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#liveTestModal input[type="url"]:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    outline: none;
}

#liveTestModal textarea {
    resize: none;
    min-height: 3rem;
    max-height: 15rem;
    height: 8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#liveTestModal textarea:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    outline: none;
}

#liveTestModal .form-text {
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.4;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.test-info {
    background: #e9ecef;
    padding: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid #0d6efd;
}

.test-info p {
    margin-bottom: 0.5rem;
}

.test-info p:last-child {
    margin-bottom: 0;
}

/* Free Badge Size Reduction */
.free-badge-small {
    font-size: 0.35em !important;
    padding: 0.2em 0.4em !important;
    line-height: 1 !important;
}

/* Mobile Sidebar Styles */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.show {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.sidebar-content {
    padding: 1rem;
}

/* Ensure proper initial visibility */
#authLinksMobile {
    display: block;
}

#userProfileMobile {
    display: none;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-menu {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive Navbar Styles */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding-top: 1rem;
    }
    
    #authLinks {
        margin-bottom: 1rem;
    }
    
    #userProfile {
        width: 100%;
        justify-content: space-between;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand i {
        font-size: 0.875rem;
    }
    
    #upgradeBtn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    #freeBadge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .dropdown-menu {
        min-width: 180px;
    }
    
    .mobile-sidebar {
        width: 280px;
        left: -280px;
    }
}

/* Improved mobile layout for the homepage upload / textarea box
   Keep all controls pinned inside the box at the inner bottom on small screens */
@media (max-width: 575.98px) {
    .upload-container {
        padding: 0 12px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .openai-input-container {
        padding: 0 6px;
    }

    .openai-input-box {
        padding: 12px;
        min-height: 120px; /* keep comfortable height on mobile */
        max-width: 100%;
        width: 100%;
        box-shadow: none; /* reduce heavy shadows on small screens */
        position: relative; /* anchor absolute controls inside */
    }

    /* Reserve space at the bottom of the textarea so absolute controls don't overlap typed text */
    .openai-textarea {
        font-size: 15px;
        padding: 12px 12px 80px 16px; /* bottom padding equals controls height + breathing room */
        min-height: 80px;
        max-height: 240px;
    }

    .input-content {
        /* keep relative positioning; controls will be absolutely positioned inside */
        position: relative;
        padding-bottom: 0;
        min-height: 80px;
    }

    /* Generation options pinned to the left inside the box */
    /* Left-side control chip group inside the box. Allow horizontal scroll if too many chips. */
    .generation-options-inside {
        position: absolute;
        left: 12px;
        bottom: 12px;
        display: flex;
        gap: 8px;
        flex-wrap: nowrap; /* keep chips on one line and allow scroll */
        align-items: center;
        z-index: 6;
        background: rgba(255,255,255,0.85);
        padding: 6px 8px;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        backdrop-filter: blur(4px);
        max-width: calc(100% - 140px); /* leave room for right-side controls */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .generation-options-inside::-webkit-scrollbar { height: 6px; }
    .generation-options-inside::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }

    .option-btn-inside {
        font-size: 0.68rem; /* slightly larger for touch targets */
        padding: 6px 10px;
    }

    /* Action group (attach + model) pinned to the right inside the box */
    /* Right-side actions pinned inside the box */
    .input-actions {
        position: absolute;
        right: 12px;
        bottom: 12px;
        display: flex;
        gap: 8px;
        align-items: center;
        z-index: 7;
        background: rgba(255,255,255,0.95);
        padding: 6px;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
        min-width: 72px;
        max-width: 45%;
    }

    /* Make controls slightly larger and touch-friendly */
    /* Make action controls flexible and touch-friendly. Model select will expand if space allows. */
    .input-actions .attach-btn,
    .input-actions .model-icon-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        padding: 4px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .input-actions #modelSelect {
        height: 36px;
        min-width: 90px !important;
        max-width: 160px !important;
        padding: 4px 8px !important;
        border-radius: 8px !important;
        display: inline-block;
        box-sizing: border-box;
    }

    /* If modelSelect is visible on slightly larger phones, cap its width */
    .input-actions #modelSelect {
        min-width: 90px !important;
        max-width: 160px !important;
        width: auto !important;
        padding: 4px 8px !important;
    }

    /* Ensure file preview icons do not force horizontal scroll */
    .file-preview-icons {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Model select compact icon for very small screens */
@media (max-width: 420px) {
    /* Hide the wide select control and show a compact icon instead */
    #modelSelect {
        display: none !important;
        visibility: hidden;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .model-icon-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
        background: white;
        color: #374151;
        font-size: 14px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
        cursor: pointer;
    }

    .model-icon-btn i {
        font-size: 14px;
    }

    /* Ensure input-actions still wraps nicely */
    .input-actions {
        gap: 6px;
    }
}

/* Dropdown Styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e5e7eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #userProfile {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
    
    #upgradeBtn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    #freeBadge {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
    }
}

/* Footer Styles */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 12px 0; /* slightly larger padding for breathing room */
    /* When body is a column flex container, margin-top:auto pushes footer to bottom
       if content is short. We still keep it non-shrinking. */
    margin-top: auto;
    font-size: 14px;
    color: #6c757d;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Tighten footer internal spacing */
.footer .container { padding-bottom: 0; }
.footer .row { margin-bottom: 0; }
.footer .col-md-4 { margin-bottom: 0; }

/* Footer links container: use flex to keep links on one line and allow horizontal
   scrolling if the total width exceeds available space. */
.footer .footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}
.footer .footer-links::-webkit-scrollbar { height: 8px; }
.footer .footer-links::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 4px; }

/* Keep footer children on a single row and force the footer links to one line.
   If viewport is too narrow, the links container scrolls horizontally. */
.footer .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
}

.footer .col-md-4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.footer .col-md-4 .footer-link {
    display: inline-block;
    margin: 0 12px 0 0;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.footer .col-md-4 .footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer .footer-ai-text {
    display: inline-block;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .footer .row {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    .footer .col-md-4 { width: 100%; text-align: center; }
    .footer .col-md-4 .footer-link { margin: 0 8px; }
}

.footer-location {
    font-weight: 500;
    color: #495057;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #007bff;
    text-decoration: none;
}

.footer-ai-text {
    font-size: 13px;
    color: #6c757d;
}

/* Footer responsive adjustments */
@media (max-width: 768px) {
    .footer .row {
        text-align: center;
    }
    
    .footer .col-md-4 {
        margin-bottom: 10px;
    }
    
    .footer-link {
        display: inline-block;
        margin: 5px 8px;
    }
}

/* Fullscreen dark overlay for centralized loader (navbar logo spinner + step text) */
.site-loader-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: none; /* shown by JS */
    justify-content: center;
    align-items: center;
    z-index: 20000;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.site-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.site-loader-logo .flask-logo,
.site-loader-logo .fa-flask,
.site-loader-logo .navbar-brand {
    width: var(--loader-logo-size, 144px);
    height: var(--loader-logo-size, 144px);
    display: block;
    pointer-events: none;
}

.site-loader-logo .flask-logo {
    animation: flask-spin 1.6s linear infinite, flask-glow 2.4s ease-in-out infinite;
    transform-origin: 50% 50%;
}

.site-loader-step {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    max-width: 80vw;
    pointer-events: none;
}

/* Slight responsive tuning */
@media (max-width: 420px) {
    .site-loader-logo .flask-logo,
    .site-loader-logo .fa-flask { width: var(--loader-logo-size-mobile, 108px); height: var(--loader-logo-size-mobile, 108px); }
    .site-loader-step { font-size: 0.95rem; }
}

/* Pricing page styles */
.pricing-container {
    background: #f8f9fa;
    color: #333;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pricing-card {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.pro-card {
    border: 2px solid #007bff;
    position: relative;
    box-shadow: 0 6px 25px rgba(0,123,255,0.15);
}

.pro-card:hover {
    box-shadow: 0 10px 35px rgba(0,123,255,0.2);
}

.pro-card .badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.price {
    color: #333;
    font-weight: 700;
}

.pricing-container h1 {
    color: #212529;
    font-weight: 800;
}

.pricing-container .lead {
    color: #6c757d;
    font-weight: 500;
}

.pricing-card h3 {
    color: #212529;
    font-weight: 700;
}

.pricing-card .card-text {
    color: #495057;
}

.pricing-card ul li {
    color: #495057;
}

.privacy-container, .terms-container, .acceptable-use-container {
    background: #f8f9fa;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-height: calc(100vh - 200px);
}

.privacy-content, .terms-content, .acceptable-use-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.privacy-content h2, .terms-content h2, .acceptable-use-content h2 {
    color: #333;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.privacy-content h3, .terms-content h3, .acceptable-use-content h3 {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.privacy-content ul, .terms-content ul, .acceptable-use-content ul {
    margin-bottom: 1rem;
}

.privacy-content li, .terms-content li, .acceptable-use-content li {
    margin-bottom: 0.5rem;
}

/* Contact page styles */
.contact-container {
    min-height: calc(100vh - 200px);
    padding: 2rem 0 4rem 0;
    background: #f8f9fa;
}

/* Deep analysis checkbox removed; styles deprecated */

/* Live Screenshot Streaming Styles */
/* Live Test Log Colors */
.text-purple {
    color: #6f42c1 !important;
}

.text-step {
    color: #007bff !important;
    font-weight: 500;
}

.text-login {
    color: #fd7e14 !important;
    font-weight: 500;
}

.text-navigation {
    color: #6f42c1 !important;
    font-weight: 500;
}

.text-objective {
    color: #28a745 !important;
    font-weight: 600;
}

.text-test-complete {
    color: #28a745 !important;
    font-weight: 600;
}

/* Enhanced log styling */
#liveTestLogs li {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: background-color 0.2s ease;
}

#liveTestLogs li:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#liveTestLogs li.text-error {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
}

#liveTestLogs li.text-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

#liveTestLogs li.text-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

#liveTestLogs li.text-step {
    background-color: rgba(0, 123, 255, 0.1);
    border-left: 3px solid #007bff;
}

#liveTestLogs li.text-login {
    background-color: rgba(253, 126, 20, 0.1);
    border-left: 3px solid #fd7e14;
}

#liveTestLogs li.text-navigation {
    background-color: rgba(111, 66, 193, 0.1);
    border-left: 3px solid #6f42c1;
}

#liveTestLogs li.text-objective {
    background-color: rgba(40, 167, 69, 0.15);
    border-left: 3px solid #28a745;
    font-weight: 600;
}

#liveTestLogs li.text-test-complete {
    background-color: rgba(40, 167, 69, 0.15);
    border-left: 3px solid #28a745;
    font-weight: 600;
}

#liveScreenshot {
    transition: opacity 0.1s ease-in-out;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

#liveScreenshot.updating {
    opacity: 0.95;
}

/* Live Test Logs Auto-scroll */
#liveTestLogs {
    scroll-behavior: smooth;
}

#liveTestLogs::-webkit-scrollbar {
    width: 6px;
}

#liveTestLogs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#liveTestLogs::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#liveTestLogs::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* File Preview Icons (inline inside text area) */
.file-preview-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.file-icon-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.35rem;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    font-size: 0.5rem;
    transition: all 0.2s;
    position: relative;
}

.file-icon-badge:hover {
    background: #333;
    border-color: #4a4a4a;
}

.file-icon-badge .file-type-icon {
    font-size: 0.5rem;
    color: #fff;
}

.file-icon-badge .file-name-short {
    color: #ccc;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-icon-badge .remove-icon {
    font-size: 0.5rem;
    color: #999;
    cursor: pointer;
    margin-left: 0.1rem;
    transition: color 0.2s;
}

.file-icon-badge .remove-icon:hover {
    color: #ff4444;
}

/* Icon color variants for inline badges */
.file-icon-badge.pdf .file-type-icon {
    color: #eb3349;
}

.file-icon-badge.document .file-type-icon {
    color: #667eea;
}

.file-icon-badge.excel .file-type-icon {
    color: #11998e;
}

.file-icon-badge.image .file-type-icon {
    color: #00d2ff;
}

.file-icon-badge.text .file-type-icon {
    color: #5f72bd;
}
