/* Styles extracted from all-in-one.html */
:root {
    /* Dark Neon Theme Variables */
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --primary: #06b6d4; /* Cyan Neon */
    --primary-glow: rgba(6, 182, 212, 0.4);
    --secondary: #8b5cf6; /* Violet Neon */
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --gold: #fbbf24; /* Gold for Key Formulas */
    --border: rgba(148, 163, 184, 0.2);
    --glass: blur(12px);
    --sw: 280px;
    --hh: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* --- Background Effects --- */


/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* --- UI Components --- */
header {
    height: var(--hh);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--primary-glow);
}

.logo-area svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary);
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-c {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

aside {
    width: var(--sw);
    background: var(--panel-bg);
    backdrop-filter: var(--glass);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
}

aside::-webkit-scrollbar {
    width: 6px;
}

aside::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sb-cat {
    font-size: 0.75rem;
    color: var(--primary);
    padding: 20px 20px 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    margin-top: 15px;
    text-shadow: 0 0 5px var(--primary-glow);
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-right: 3px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--text-main);
    padding-right: 25px;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), transparent);
    color: var(--primary);
    border-right-color: var(--primary);
    font-weight: bold;
    text-shadow: 0 0 8px var(--primary-glow);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.sec {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.sec.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-bottom: 25px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    display: inline-block;
    font-size: 1.8rem;
    text-shadow: 0 0 10px var(--primary-glow);
}

h3 {
    margin: 20px 0 15px;
    color: var(--secondary);
    font-size: 1.1rem;
}

/* --- Cards & Inputs --- */
.card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.grp-box {
    background: rgba(15, 23, 42, 0.5);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.grp-title {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
    font-size: 0.9rem;
}

.f-grp {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.rad-grp {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.rad-grp label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* --- Math & Results --- */
.math {
    font-family: "Times New Roman", serif;
    font-style: italic;
    direction: ltr;
    display: inline-block;
}

.math sub,
.math sup {
    font-size: 0.7em;
    margin: 0 0.1em;
}

.res-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    display: none;
    font-size: 1rem;
    border: 1px solid var(--border);
}

.res-box.show {
    display: block;
    animation: fadeIn 0.4s;
}

.res-box.ok {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #34d399;
}

.res-box.err {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #f87171;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 5px;
}

.stat-val {
    direction: ltr;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
}

.decision {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
}

.dec-rej {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.dec-acc {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.eq-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    direction: ltr;
    font-family: "Times New Roman", serif;
    font-size: 1.2rem;
    border: 1px solid var(--gold);
    color: var(--gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
}

/* Trust Path Styles */
.math-box {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    display: none;
}

.math-box.show {
    display: block;
}

.math-title {
    font-weight: bold;
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.math-title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 20px;
    background: var(--secondary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--secondary);
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.3rem;
    text-align: center;
    direction: ltr;
    padding: 15px 0;
    color: var(--text-main);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

.fraction {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    margin: 0 8px;
}

.fraction>span {
    display: block;
    padding: 0 5px;
}

.fraction span.numerator {
    border-bottom: 2px solid var(--text-muted);
}

.sqrt {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin: 0 4px;
}

.sqrt::before {
    content: "\221A";
    font-size: 1.3em;
    margin-left: 4px;
    color: var(--primary);
}

.sqrt::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: var(--text-muted);
    z-index: -1;
}

.sqrt-inner {
    border-top: 1px solid var(--text-muted);
    padding-top: 2px;
    padding-left: 4px;
}

.steps-list {
    list-style: none;
    counter-reset: step;
}

.steps-list li {
    position: relative;
    padding-right: 30px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid var(--primary);
}

.steps-list strong {
    color: var(--text-main);
}

/* Chi Square Grid */
.chi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.chi-cell {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
}

.chi-head {
    background: rgba(6, 182, 212, 0.1);
    font-weight: bold;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    color: var(--primary);
}

/* --- Responsive Design --- */

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--hh);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--hh));
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    :root {
        --hh: 60px; /* Slightly smaller header on mobile */
    }

    .menu-btn {
        display: block;
    }

    /* Sidebar Logic */
    aside {
        position: fixed;
        top: var(--hh);
        right: 0; /* Start from right edge */
        height: calc(100vh - var(--hh));
        width: 80%; /* Wider sidebar for better touch targets */
        max-width: 300px;
        transform: translateX(100%); /* Hide off-screen to the right */
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    }

    aside.open {
        transform: translateX(0); /* Slide in */
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main Content Adjustments */
    main {
        padding: 20px 15px; /* Less padding on sides */
    }

    .sec {
        max-width: 100%; /* Full width usage */
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    /* Grids to Single Column */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Inputs & Buttons */
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px;
    }

    button {
        padding: 16px;
        font-size: 1.1rem;
    }

    /* Chi Square Grid Responsive */
    .chi-grid {
        grid-template-columns: 1fr; /* Stack cells */
        gap: 5px;
    }
    
    .chi-head {
        display: none; /* Hide headers on very small screens if needed, or keep them */
    }

    /* Card Adjustments */
    .card {
        padding: 20px;
        border-radius: 12px;
    }

    /* Formula Box */
    .eq-box {
        font-size: 1rem;
        overflow-x: auto; /* Allow scrolling for long formulas */
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    h2 { font-size: 1.3rem; }
    .logo-area span { display: none; } /* Hide text logo if needed, keep icon */
    .logo-area svg { width: 32px; height: 32px; }
}