/* === Redline AI — Neo-Brutalist Glassmorphism === */
/* Dark bg, radial red gradient, film grain, dark glass cards, Geist font */

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Base === */
body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #111111;
    color: #F2F0E9;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* === Radial Gradient Background === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(
        ellipse at center,
        #CC0000 0%,
        #414042 30%,
        #1a1a1a 60%,
        #111111 100%
    );
    pointer-events: none;
}

/* === Film Grain Overlay === */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.08;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* === Top-Left: Logo + Nav === */
.nav-left {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 50;
}

@media (min-width: 768px) {
    .nav-left {
        top: 24px;
        left: 24px;
    }
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .logo-group {
        margin-bottom: 40px;
    }
}

.logo-svg {
    height: 20px;
    flex-shrink: 0;
}

.logo-text {
    color: #F2F0E9;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    width: 70px;
    line-height: 1.2;
}

.logo-sup {
    font-size: 10px;
    vertical-align: super;
    line-height: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .nav-links {
        gap: 20px;
    }
}

.nav-link {
    font-size: 12px;
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: opacity 0.3s ease, color 0.3s ease;
    color: #D1D3D4;
    font-weight: 300;
}

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

.nav-link.active {
    color: #F2F0E9;
    font-weight: 400;
}

.nav-link.disabled {
    color: #555555;
    cursor: default;
    font-weight: 300;
    position: relative;
}

.nav-link.disabled::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17, 17, 17, 0.9);
    color: #D1D3D4;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.05em;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(242, 240, 233, 0.1);
}

.nav-link.disabled:hover::after {
    opacity: 1;
}

body.light-mode .nav-link.disabled::after {
    background: rgba(0, 0, 0, 0.8);
    color: #F2F0E9;
    border-color: rgba(0, 0, 0, 0.2);
}

/* === Top-Right: Clock + Toggles === */
.util-right {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    text-align: right;
}

@media (min-width: 768px) {
    .util-right {
        top: 24px;
        right: 24px;
    }
}

.clock-time {
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 11px;
    color: #D1D3D4;
    margin-bottom: 2px;
    letter-spacing: 0.15em;
}

.clock-date {
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 11px;
    color: #D1D3D4;
    margin-bottom: 12px;
    letter-spacing: 0.15em;
}

.theme-toggles {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(209, 211, 212, 0.4);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #414042;
    border-color: #F2F0E9;
}

/* === Center: Main Content Wrapper === */
.hero-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 88px 16px 200px 16px;
    min-height: 100vh;
}

@media (min-width: 768px) {
    .hero-wrapper {
        padding-top: 100px;
        padding-bottom: 240px;
    }
}

/* === Glass Card Base === */
.glass-card {
    background: rgba(65, 64, 66, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(242, 240, 233, 0.2);
    border-radius: 16px;
    transition: all 300ms ease-out;
}

.glass-card:hover {
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    background: rgba(65, 64, 66, 0.18);
}

/* Solid dark glass for results — much more readable over red gradient */
.results-card {
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border: 1px solid rgba(242, 240, 233, 0.12);
}

.results-card:hover {
    background: rgba(17, 17, 17, 0.88);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
}

/* === Hero / Landing Card === */
.hero-card {
    padding: 32px 32px 32px 32px;
    max-width: 500px;
    width: 100%;
    animation: fadeInScale 600ms ease-out;
}

@media (min-width: 768px) {
    .hero-card {
        padding: 40px 56px 40px 56px;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.asterisk-icon {
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .asterisk-icon {
        margin-bottom: 40px;
    }
}

.hero-headline {
    color: #F2F0E9;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .hero-headline {
        font-size: 36px;
        margin-bottom: 40px;
    }
}

.hero-desc {
    color: #D1D3D4;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 32px;
}

.sm-hide {
    display: none;
}

@media (min-width: 640px) {
    .sm-hide {
        display: inline;
    }
}

/* === CTA Button === */
.cta-btn {
    background: #F2F0E9;
    color: #111111;
    font-family: 'Geist', -apple-system, sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.15em;
    padding: 10px 28px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.cta-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* === Tool Card (Upload, Scanning, Results) === */
.tool-card {
    padding: 32px;
    max-width: 560px;
    width: 100%;
    animation: fadeInScale 400ms ease-out;
}

@media (min-width: 768px) {
    .tool-card {
        padding: 40px 48px;
    }
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.tool-title {
    color: #F2F0E9;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .tool-title {
        font-size: 24px;
    }
}

/* === Badge === */
.badge {
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-regex {
    background: rgba(209, 211, 212, 0.1);
    color: #D1D3D4;
    border: 1px solid rgba(209, 211, 212, 0.2);
}

.badge-llm {
    background: rgba(204, 0, 0, 0.15);
    color: #e63946;
    border: 1px solid rgba(204, 0, 0, 0.3);
}

/* === Tabs === */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(242, 240, 233, 0.1);
}

.tab {
    background: none;
    border: none;
    color: #D1D3D4;
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.15em;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: #F2F0E9;
}

.tab.active {
    color: #F2F0E9;
    font-weight: 400;
    border-bottom-color: #CC0000;
}

/* === Textarea === */
#text-input {
    width: 100%;
    background: rgba(65, 64, 66, 0.2);
    border: 1px solid rgba(242, 240, 233, 0.15);
    border-radius: 12px;
    color: #F2F0E9;
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 12px;
    font-weight: 300;
    padding: 16px;
    resize: vertical;
    min-height: 160px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    line-height: 1.6;
}

#text-input:focus {
    outline: none;
    border-color: rgba(204, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

#text-input::placeholder {
    color: #555555;
}

/* === Drop Zone === */
.drop-zone {
    border: 2px dashed rgba(242, 240, 233, 0.15);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #CC0000;
    background: rgba(204, 0, 0, 0.05);
}

.drop-text {
    color: #D1D3D4;
    font-size: 13px;
    font-weight: 300;
    margin: 12px 0 8px;
}

.drop-hint {
    color: #555555;
    font-size: 11px;
    font-weight: 300;
    margin-top: 8px;
    letter-spacing: 0.1em;
}

.file-label {
    display: inline-block;
    background: rgba(242, 240, 233, 0.1);
    color: #F2F0E9;
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    padding: 8px 20px;
    border-radius: 9999px;
    border: 1px solid rgba(242, 240, 233, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background: rgba(242, 240, 233, 0.2);
    border-color: rgba(242, 240, 233, 0.4);
}

/* === File Info === */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(65, 64, 66, 0.2);
    border: 1px solid rgba(242, 240, 233, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
}

.file-info span {
    color: #D1D3D4;
    font-size: 12px;
    font-weight: 300;
    font-family: 'Geist Mono', monospace;
}

.clear-file {
    background: none;
    border: none;
    color: #888888;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0 4px;
}

.clear-file:hover {
    color: #CC0000;
}

/* === Scan Button === */
.scan-btn {
    width: 100%;
    margin-top: 20px;
}

/* === Back Link === */
.back-link {
    background: none;
    border: none;
    color: #555555;
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-top: 16px;
    padding: 4px 0;
}

.back-link:hover {
    color: #D1D3D4;
}

/* === Scanning View === */
.scanning-content {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(242, 240, 233, 0.1);
    border-top-color: #CC0000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scanning-text {
    color: #F2F0E9;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 8px;
}

.scanning-detail {
    color: #555555;
    font-size: 12px;
    font-weight: 300;
    font-family: 'Geist Mono', monospace;
    letter-spacing: 0.1em;
}

/* === Results === */
.results-wrapper {
    max-width: 640px;
    width: 100%;
    animation: fadeInScale 400ms ease-out;
}

.results-card {
    max-width: 640px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.results-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(242, 240, 233, 0.1);
}

.meta-stat {
    text-align: center;
}

.meta-stat .value {
    font-family: 'Geist Mono', monospace;
    font-size: 24px;
    font-weight: 500;
    color: #F2F0E9;
    display: block;
}

.meta-stat .label {
    font-size: 10px;
    font-weight: 300;
    color: #555555;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 4px;
    display: block;
}

/* === No Issues === */
.no-issues {
    text-align: center;
    padding: 40px 0;
}

.no-issues svg {
    margin-bottom: 16px;
}

.no-issues p {
    color: #34d399;
    font-size: 14px;
    font-weight: 400;
}

/* === Category Summary === */
.category-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.cat-badge:hover {
    transform: translateY(-1px);
}

.cat-badge .count {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    background: rgba(242, 240, 233, 0.1);
    padding: 1px 6px;
    border-radius: 9999px;
    min-width: 20px;
    text-align: center;
}

/* Category Colors */
.cat-punctuation { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.cat-numbers { background: rgba(96, 165, 250, 0.12); color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
.cat-capitalization { background: rgba(236, 72, 153, 0.12); color: #ec4899; border-color: rgba(236, 72, 153, 0.3); }
.cat-grammar { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
.cat-word_choice { background: rgba(52, 211, 153, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
.cat-quotations { background: rgba(167, 139, 250, 0.12); color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }

/* === Category Group === */
.category-group {
    margin-bottom: 16px;
}

.category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 8px;
}

.category-heading:hover {
    background: rgba(30, 30, 30, 0.7);
}

.category-heading h3 {
    font-size: 13px;
    font-weight: 500;
    color: #F2F0E9;
    letter-spacing: 0.05em;
}

.category-heading .toggle {
    color: #555555;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.category-heading .toggle.collapsed {
    transform: rotate(-90deg);
}

/* === Issue Card === */
.issue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.issue-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(242, 240, 233, 0.1);
    border-radius: 12px;
    padding: 16px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.issue-card:hover {
    background: rgba(40, 40, 40, 0.8);
}

/* Severity border colors */
.issue-card.severity-error { border-left-color: #ef4444; }
.issue-card.severity-warning { border-left-color: #f59e0b; }
.issue-card.severity-suggestion { border-left-color: #60a5fa; }

.issue-line {
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    color: #888888;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.issue-matched {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(242, 240, 233, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: #F2F0E9;
    word-break: break-word;
}

.issue-message {
    color: #F2F0E9;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 8px;
}

.issue-citation {
    color: #CC0000;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Severity Tags */
.severity-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-left: 8px;
}

.severity-tag.severity-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.severity-tag.severity-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.severity-tag.severity-suggestion {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* === Error Banner === */
.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 300;
}

/* === Bottom: Decorative Glass Card (bleeds off page) === */
.bottom-glass-wrapper {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    width: 500px;
    max-width: calc(100% - 32px);
    transition: z-index 0s, opacity 0.3s ease;
}

/* When behind: lower z-index so it sits under the tool card */
.bottom-glass-wrapper.behind {
    z-index: 5;
}

@media (min-width: 768px) {
    .bottom-glass-wrapper {
        bottom: -50px;
    }
}

.bottom-glass-card {
    width: 100%;
    height: 120px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* === Bottom Bar (Three-Column Text Overlay) === */
.bottom-bar {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .bottom-bar {
        bottom: 24px;
        padding: 0 24px;
    }
}

.bottom-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.bottom-middle {
    flex: 0 0 auto;
    width: 100%;
    max-width: 500px;
}

.bottom-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.bottom-meta {
    color: #414042;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.8;
}

.copyright {
    color: #414042;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 2px;
}

.copyright sup {
    font-size: 8px;
    vertical-align: super;
}

.red-dashes {
    color: #ff000d;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.15em;
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* === Mono Font Utility === */
.font-mono {
    font-family: 'Geist Mono', 'Courier New', monospace;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(242, 240, 233, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(242, 240, 233, 0.25);
}

/* === Forms (Feedback + Waitlist) === */
.form-desc {
    font-size: 13px;
    font-weight: 300;
    color: #D1D3D4;
    line-height: 1.6;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #888888;
    margin-bottom: 6px;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(65, 64, 66, 0.25);
    border: 1px solid rgba(242, 240, 233, 0.12);
    border-radius: 8px;
    color: #F2F0E9;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-select:focus {
    border-color: #CC0000;
}

.form-select option {
    background: #1a1a1a;
    color: #F2F0E9;
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(65, 64, 66, 0.25);
    border: 1px solid rgba(242, 240, 233, 0.12);
    border-radius: 8px;
    color: #F2F0E9;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-textarea:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.form-textarea::placeholder {
    color: #555555;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(65, 64, 66, 0.25);
    border: 1px solid rgba(242, 240, 233, 0.12);
    border-radius: 8px;
    color: #F2F0E9;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 300;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.form-input::placeholder {
    color: #555555;
}

.char-count {
    display: block;
    text-align: right;
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    color: #555555;
    margin-top: 4px;
}

.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 0;
}

.success-text {
    font-size: 14px;
    font-weight: 400;
    color: #F2F0E9;
}

/* === Upsell Popup Strip (top of results card) === */
.upsell-popup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -32px -32px 24px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px 16px 0 0;
}

@media (min-width: 768px) {
    .upsell-popup {
        margin: -40px -48px 24px;
        padding: 12px 32px;
    }
}

.upsell-popup-text {
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.upsell-popup-btn {
    background: #CC0000;
    border: none;
    color: #fff;
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 5px 16px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.upsell-popup-btn:hover {
    background: #a00000;
}

/* === Hamburger Menu (hidden on desktop) === */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: #F2F0E9;
    transition: all 0.3s ease;
}

/* ================================================ */
/* === Light Mode === */
/* ================================================ */

body.light-mode {
    background: #F5F3EE;
    color: #1a1a1a;
}

body.light-mode::before {
    background: radial-gradient(
        ellipse at center,
        rgba(204, 0, 0, 0.06) 0%,
        rgba(200, 180, 160, 0.25) 30%,
        #EDE8E0 60%,
        #F5F3EE 100%
    );
}

body.light-mode .film-grain {
    opacity: 0.03;
}

/* Light glass cards */
body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .glass-card:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* Light text */
body.light-mode .hero-headline,
body.light-mode .tool-title,
body.light-mode .category-heading h3,
body.light-mode .scanning-text {
    color: #1a1a1a;
}

body.light-mode .hero-desc,
body.light-mode .drop-text,
body.light-mode .file-info span {
    color: #333333;
}

body.light-mode .logo-text {
    color: #1a1a1a;
}

/* Light nav */
body.light-mode .nav-link {
    color: #555555;
}

body.light-mode .nav-link.active,
body.light-mode .nav-link:hover {
    color: #1a1a1a;
}

body.light-mode .nav-link.disabled {
    color: #aaaaaa;
}

/* Light clock */
body.light-mode .clock-time,
body.light-mode .clock-date {
    color: #666666;
}

/* Light toggle button */
body.light-mode .toggle-btn {
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
}

/* Light textarea */
body.light-mode #text-input {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.light-mode #text-input:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.08);
}

body.light-mode #text-input::placeholder {
    color: #888888;
}

/* Light drop zone */
body.light-mode .drop-zone {
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .drop-zone:hover,
body.light-mode .drop-zone.dragover {
    border-color: #CC0000;
    background: rgba(204, 0, 0, 0.03);
}

/* Light file label */
body.light-mode .file-label {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Light CTA button */
body.light-mode .cta-btn {
    background: #1a1a1a;
    color: #F5F3EE;
}

body.light-mode .cta-btn:hover {
    background: #333333;
}

body.light-mode .cta-btn:disabled {
    background: rgba(0, 0, 0, 0.08);
    color: #aaaaaa;
}

/* Light badges */
body.light-mode .badge-regex {
    background: rgba(0, 0, 0, 0.05);
    color: #888888;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .badge-llm {
    background: rgba(204, 0, 0, 0.08);
    color: #CC0000;
    border-color: rgba(204, 0, 0, 0.2);
}

/* Light tabs */
body.light-mode .tab {
    color: #666666;
}

body.light-mode .tab:hover,
body.light-mode .tab.active {
    color: #1a1a1a;
}

body.light-mode .tab-bar {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Light results */
body.light-mode .results-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .results-card:hover {
    background: rgba(255, 255, 255, 0.92);
}

body.light-mode .meta-stat .value {
    color: #1a1a1a;
}

body.light-mode .meta-stat .label {
    color: #666666;
}

body.light-mode .results-meta {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Light issue cards */
body.light-mode .issue-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .issue-card:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-mode .issue-matched {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

body.light-mode .issue-message {
    color: #1a1a1a;
}

body.light-mode .issue-line {
    color: #777777;
}

/* Light category headings */
body.light-mode .category-heading {
    background: rgba(0, 0, 0, 0.04);
}

body.light-mode .category-heading:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Light spinner */
body.light-mode .spinner {
    border-color: rgba(0, 0, 0, 0.08);
    border-top-color: #CC0000;
}

body.light-mode .scanning-detail {
    color: #777777;
}

/* Light bottom elements */
body.light-mode .bottom-meta,
body.light-mode .copyright {
    color: #555555;
}

/* Light asterisk icon */
body.light-mode .asterisk-icon line {
    stroke: #CC0000;
}

/* Light back link */
body.light-mode .back-link {
    color: #777777;
}

body.light-mode .back-link:hover {
    color: #333333;
}

/* Light file info */
body.light-mode .file-info {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .clear-file {
    color: #aaaaaa;
}

body.light-mode .clear-file:hover {
    color: #CC0000;
}

/* Light scrollbar */
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Light form overrides */
body.light-mode .form-desc {
    color: #555555;
}

body.light-mode .form-select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.light-mode .form-select option {
    background: #F5F3EE;
    color: #1a1a1a;
}

body.light-mode .form-textarea {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.light-mode .form-textarea::placeholder {
    color: #aaaaaa;
}

body.light-mode .form-input {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.light-mode .form-input::placeholder {
    color: #aaaaaa;
}

body.light-mode .success-text {
    color: #1a1a1a;
}

/* Light upsell popup — black strip */
body.light-mode .upsell-popup {
    background: rgba(0, 0, 0, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.light-mode .upsell-popup-text {
    color: #F2F0E9;
}

body.light-mode .hamburger span {
    background: #1a1a1a;
}

/* ================================================ */
/* === Mobile (max-width: 767px) === */
/* ================================================ */

@media (max-width: 767px) {

    /* === Mobile Top Bar: Logo left, moon + hamburger right === */

    /* Make .nav-left a full-width horizontal top bar */
    .nav-left {
        top: 0;
        left: 0;
        right: 0;
        padding: 14px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Logo stays visible but compact — no bottom margin */
    .logo-group {
        margin-bottom: 0;
    }

    /* Hamburger on far right of the top bar */
    .hamburger {
        display: flex;
        order: 2;
    }

    /* Nav links: dropdown panel below the top bar */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 16px;
        background: rgba(17, 17, 17, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 20px 24px;
        border-bottom: 1px solid rgba(242, 240, 233, 0.1);
        margin-top: 0;
    }

    .nav-left.nav-open .nav-links {
        display: flex;
    }

    /* Hamburger X animation when open */
    .nav-left.nav-open .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }
    .nav-left.nav-open .hamburger span:nth-child(2) {
        opacity: 0;
    }
    .nav-left.nav-open .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -3px);
    }

    /* === Theme toggle: sits just left of hamburger, vertically aligned === */
    .util-right {
        top: 0;
        right: 0;
        left: auto;
        padding: 14px 52px 14px 0;
        height: auto;
        display: flex;
        align-items: center;
        z-index: 51;
    }

    /* Hide clock on mobile */
    .clock-time,
    .clock-date {
        display: none;
    }

    /* === Bottom Bar: stacked, centered, readable === */
    .bottom-bar {
        bottom: 12px;
        padding: 0 16px;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .bottom-left {
        flex: none;
        text-align: center;
    }

    .bottom-middle {
        display: none;
    }

    .bottom-right {
        flex: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .bottom-meta {
        font-size: 9px;
        letter-spacing: 0.12em;
        line-height: 1.6;
        text-align: center;
    }

    .copyright {
        font-size: 9px;
    }

    .red-dashes {
        font-size: 9px;
    }

    /* === Content area: center card vertically on mobile === */
    .hero-wrapper {
        padding-top: 64px;
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 100px;
        align-items: center;
        min-height: 100vh;
    }

    .hero-card {
        padding: 24px 20px;
    }

    .hero-headline {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .tool-card {
        padding: 24px 20px;
    }

    /* Results full width */
    .results-wrapper {
        max-width: 100%;
    }

    .results-card {
        max-width: 100%;
    }

    .results-meta {
        flex-wrap: wrap;
        gap: 16px;
    }

    /* Category badges */
    .category-summary {
        gap: 6px;
    }

    .cat-badge {
        font-size: 9px;
        padding: 4px 10px;
    }

    /* Issue cards */
    .issue-card {
        padding: 12px;
    }

    .issue-matched {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Hide bottom decorative glass card */
    .bottom-glass-wrapper {
        display: none;
    }

    /* Touch-friendly buttons */
    .cta-btn {
        padding: 12px 28px;
        font-size: 13px;
    }

    /* Touch-friendly inputs */
    #text-input {
        font-size: 14px;
        min-height: 140px;
    }

    .drop-zone {
        padding: 30px 16px;
    }

    .tab {
        padding: 10px 16px;
        font-size: 11px;
    }

    /* Form inputs touch-friendly (16px prevents iOS zoom) */
    .form-select,
    .form-input {
        font-size: 16px;
        padding: 12px 14px;
    }

    .form-textarea {
        font-size: 16px;
    }

    /* Light mode: nav dropdown background */
    body.light-mode .nav-links {
        background: rgba(245, 243, 238, 0.95);
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }
}
