/* ShoyHuman Premium Design System - 2025 Edition */
:root {
    --bg-main: #020617;
    --bg-darker: #010411;
    --bg-card: rgba(15, 23, 42, 0.7);
    --border-accent: rgba(168, 85, 247, 0.2);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-purple: #a855f7;
    --accent-indigo: #6366f1;
    --accent-glow: rgba(168, 85, 247, 0.15);
    --font-main: 'Outfit', 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* UTILS */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

/* HERO SECTION */
.hero-section {
    position: relative;
    padding: 8rem 0 4rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.15), transparent 70%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: url('/assets/H_tree_ultra_organic.svg');
    background-position: center;
    background-size: 150px auto;
    background-repeat: repeat;
    opacity: 0.12;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    z-index: 10;
}

.splash-badge {
    display: inline-flex;
    padding: 0.5rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-purple);
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.splash-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.splash-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* FEATURED TOOL CARD IN HERO */
.featured-tool-card {
    text-align: left;
    display: block;
    margin: 0 auto;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-accent);
    padding: 2rem;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.featured-tool-card:hover {
    transform: translateY(-8px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.1);
}

.featured-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.featured-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.featured-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
}

.featured-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-indigo) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    font-weight: 700;
    width: fit-content;
}

/* CATALOG SECTION */
.catalog-section {
    padding: 4rem 0 8rem;
    background: var(--bg-darker);
}

.tool-category {
    margin: 0 auto 6rem;
    max-width: 1200px;
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

/* TOOL CARD */
.tool-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.tool-card.is-popular {
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.05);
}

.tool-card.is-popular:hover {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
}

.tool-preview {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tool-icon {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 0;
}

.badge.new {
    background: #10b981;
    color: #fff;
}

.badge.popular {
    background: #f59e0b;
    color: #fff;
}

.badge.commercial {
    background: #ef4444;
    color: #fff;
}

.tool-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.duration-badge,
.limit-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0;
}

.tool-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
    padding: 0.75rem;
    border-radius: 0;
    margin-bottom: 1.5rem;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.link-icon {
    transition: transform 0.2s;
}

.tool-card:hover .link-icon {
    transform: translateX(4px);
}

/* LEGAL DISCLAIMER */
.legal-disclaimer {
    padding: 6rem 0;
    background: var(--bg-main);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.disclaimer-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: left;
}

.disclaimer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.disclaimer-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}

.disclaimer-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.disclaimer-footer {
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.disclaimer-footer a {
    color: var(--accent-purple);
    text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .splash-title {
        font-size: 2.5rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* --- BCORRECT EDITOR LAYOUT (LIGHT THEME) --- */
.bcorrect-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-family: inherit;
    background: #fdfdfd;
    color: #111827;
}

.layout-header {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.layout-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #111;
}

.model-badge {
    font-size: 0.65rem;
    border: 1px solid #6b7280;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff;
    color: #4b5563;
    font-weight: 700;
}

.editor-grid {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    .bcorrect-layout {
        height: 100dvh;
        /* Dynamic viewport height supports mobile virtual keyboard */
    }

    .editor-grid {
        flex-direction: column;
        overflow: hidden;
    }

    .pane {
        flex: 1;
        /* Share available vertical space equally */
        height: 50%;
        min-height: 0;
        /* Crucial to let it shrink when keyboard is up */
        overflow-y: auto;
    }

    .left-pane {
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
    }

    .test-buttons {
        flex-wrap: wrap;
    }

    .layout-header h1 {
        font-size: 1.25rem;
    }
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.left-pane {
    border-right: 1px solid #e5e7eb;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.pane-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
}

.word-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.editor-textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #111827;
    background: #fff;
    outline: none;
}

.output-area {
    flex: 1;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #111827;
    overflow-y: auto;
    background: #fff;
    position: relative;
}

.placeholder {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.copy-btn {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.copy-btn:hover:not(:disabled) {
    background: #d1d5db;
    color: #111;
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.corrected-word {
    background: rgba(16, 185, 129, 0.15);
    border-bottom: 2px solid #10b981;
    padding: 0 2px;
}

.tells-panel {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem 1.5rem;
    max-height: 30vh;
    overflow-y: auto;
}

.tells-panel h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #374151;
}

.tells-panel.hidden {
    display: none;
}

.suggestion-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.suggestion-header {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.original-word {
    color: #ef4444;
    text-decoration: line-through;
}

.suggestion-word {
    color: #10b981;
}

.suggestion-explanation {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0 0 0.5rem 0;
}

.suggestion-actions {
    display: flex;
    justify-content: flex-end;
}

.ignore-btn {
    font-size: 0.75rem;
    color: #6b7280;
    background: transparent;
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.ignore-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.layout-footer {
    display: none;
    /* Hide footer to match old simple layout */
}

/* Ensure Singularity Overlay matches */
.singularity-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.singularity-overlay.active {
    display: flex;
}

.overlay-content {
    background: #000;
    border: 1px solid #a855f7;
    width: 600px;
    border-radius: 0;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #333;
}

.overlay-header h2 {
    margin: 0;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
}

.overlay-footer {
    padding: 1rem;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.8rem;
    text-align: center;
}

/* Processing styling */
.output-area.processing {
    opacity: 0.7;
}

.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.progress-bar-container {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    margin-top: 15px;
    border-radius: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 2px;
}

.processing-text {
    font-weight: 600;
    color: #374151;
}

/* --- HUD Navigation --- */
.hud-navigation {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    font-family: inherit;
}

.hud-trigger {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hud-trigger:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.05);
}

.dot {
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 0;
}

.hud-panel {
    position: absolute;
    top: 0;
    right: 60px;
    width: 280px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: translateX(100%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.hud-panel.panel_visible {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.hud-content {
    padding: 24px;
}

.hud-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 20px 0;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.hud-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.hud-nav-item span {
    flex: 1;
    text-align: left;
}

.hud-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .hud-panel {
        width: calc(100vw - 40px);
        right: 0;
        top: 60px;
    }
}