/* ============================================================
   Conductivity & Resistivity Explorer — Page Styles
   ============================================================ */

/* Workspace fills viewport */
.workspace {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

/* ─── Top Bar ─────────────────────────────────────────────── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.2rem;
    background: rgba(11, 13, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-btn {
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.hub-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e7ff;
    letter-spacing: -0.3px;
}

/* ─── Canvas Wrap ─────────────────────────────────────────── */
.canvas-wrap {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    z-index: 1;
}

canvas#simCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ─── Welcome Overlay ─────────────────────────────────────── */
.cond-welcome {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.6s ease;
}

.cond-welcome-inner {
    text-align: center;
    animation: welcomePulse 3s ease-in-out infinite;
}

.cond-welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 0 20px rgba(129, 140, 248, 0.5));
}

.cond-welcome h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e0e7ff;
    margin-bottom: 0.5rem;
}

.cond-welcome p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    max-width: 380px;
    margin: 0 auto 1rem;
}

.cond-welcome-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
}

@keyframes welcomePulse {
    0%, 100% { opacity: 0.7; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-4px); }
}

/* ─── Side Panel (controls) ───────────────────────────────── */
.side-panel {
    position: absolute;
    top: 68px;
    bottom: 20px;
    right: 20px;
    width: 300px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    z-index: 10;
}

.panel-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid rgba(129, 140, 248, 0.15);
    padding-bottom: 0.4rem;
}

.ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ctrl-group label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.slider-value {
    min-width: 60px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 600;
    color: #c7d2fe;
    font-variant-numeric: tabular-nums;
}

.reset-btn {
    margin-top: auto;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─── HUD Panel (bottom-left) ─────────────────────────────── */
.hud-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 280px;
    z-index: 20;
}

.hud-heading {
    color: #10b981 !important;
    border-bottom-color: rgba(16, 185, 129, 0.15) !important;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.hud-label {
    color: rgba(255, 255, 255, 0.55);
}

.hud-val {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    color: #a5b4fc;
}

.accent-val {
    color: #00ffcc !important;
    font-weight: 700;
    font-size: 0.88rem;
}

.hud-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.5rem 0;
}

/* ─── Formula Badge (bottom center) ──────────────────────── */
.formula-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    padding: 0.5rem 0.1rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.64rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    pointer-events: none;
}

.formula-sep {
    color: rgba(255, 255, 255, 0.15);
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .workspace {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .side-panel {
        position: relative;
        top: 0;
        bottom: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: none;
        margin-top: 10px;
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .canvas-wrap {
        position: relative;
        top: 0;
        width: 100%;
        height: 50vh;
        min-height: 320px;
    }

    .hud-panel {
        position: relative;
        bottom: 0;
        left: 0;
        width: 100%;
        margin-top: 10px;
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .formula-badge {
        display: none;
    }
}
