:root {
    --bg-base: #060913;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-placeholder: #4b5563;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(17, 24, 39, 0.6);
    --brand-grad: linear-gradient(135deg, #38bdf8, #818cf8);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    position: relative;
}

/* Background Animation */
.bg-shapes {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    overflow: hidden; z-index: -1;
}
.shape {
    position: absolute; filter: blur(120px); border-radius: 50%;
    animation: float 20s infinite ease-in-out; opacity: 0.4;
}
.shape-1 { width: 50vw; height: 50vw; background: #3b82f6; top: -10vw; left: -10vw; animation-delay: 0s; }
.shape-2 { width: 40vw; height: 40vw; background: #8b5cf6; bottom: -10vw; right: -5vw; animation-delay: -5s; }
.shape-3 { width: 45vw; height: 45vw; background: #10b981; top: 40%; left: 30%; animation-delay: -10s; opacity: 0.2; }

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.app-container {
    display: flex; width: 100%; max-width: 1600px; margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 280px; position: fixed; height: 100vh;
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem; display: flex; flex-direction: column; z-index: 10;
}

.logo {
    display: flex; align-items: center; gap: 1rem;
    font-size: 1.6rem; font-weight: 700; margin-bottom: 3.5rem;
}
.logo-icon {
    width: 40px; height: 40px; background: var(--brand-grad);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4); font-size: 1.2rem;
}
.text-gradient {
    background: var(--brand-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-divider {
    font-size: 0.75rem; font-weight: 700; color: var(--text-placeholder);
    letter-spacing: 1.5px; margin: 1rem 0 0.5rem 1rem;
}

.category-nav { display: flex; flex-direction: column; gap: 0.4rem; flex-grow: 1; }
.nav-btn {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem;
    background: transparent; border: 1px solid transparent; border-radius: 14px;
    color: var(--text-secondary); font-size: 1rem; font-weight: 500;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.nav-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.nav-btn i { font-size: 1.2rem; transition: transform 0.3s; width: 24px; text-align: center; }
.nav-btn:hover i { transform: scale(1.1); }
.nav-btn.active {
    background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.1);
}
.active-indicator {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 20px; background: var(--brand-grad); border-radius: 4px 0 0 4px;
}

.sidebar-footer .glass-panel {
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color);
    padding: 1.2rem; border-radius: 16px; font-size: 0.85rem; color: var(--text-secondary);
    line-height: 1.5; display: flex; gap: 0.8rem; align-items: flex-start;
}
.sidebar-footer i { font-size: 1.2rem; margin-top: 2px; }

/* Main Content */
.main-content { margin-left: 280px; padding: 2.5rem 3rem; width: calc(100% - 280px); }

/* Header */
.top-header {
    display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 3.5rem;
}
.page-title { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.page-subtitle { color: var(--text-secondary); font-size: 1.1rem; }

.header-right { display: flex; gap: 1.5rem; align-items: center; }
.search-bar {
    position: relative; width: 320px;
}
.search-bar i {
    position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary);
}
.search-kbd {
    position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); padding: 0.2rem 0.5rem; border-radius: 6px;
    font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; font-family: monospace;
}
.search-bar input {
    width: 100%; padding: 1rem 3.5rem 1rem 3rem; background: var(--glass-bg);
    border: 1px solid var(--border-color); border-radius: 16px; color: #fff;
    font-size: 1rem; outline: none; backdrop-filter: blur(10px); transition: all 0.3s;
}
.search-bar input:focus {
    border-color: rgba(56, 189, 248, 0.5); background: rgba(17, 24, 39, 0.8);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.glass-btn {
    background: var(--glass-bg); border: 1px solid var(--border-color);
    padding: 1rem 1.5rem; border-radius: 16px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.8rem; font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Calculators Grid */
.calculators-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 2rem;
}

/* Card Design */
.calc-card {
    position: relative; border-radius: 24px; padding: 1px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column;
}
.calc-card:hover { transform: translateY(-8px); z-index: 2; }
.card-glow {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 0%, var(--glow-color), transparent 70%);
    opacity: 0; transition: opacity 0.4s; border-radius: 24px; pointer-events: none; z-index: 0;
}
.calc-card:hover .card-glow { opacity: 0.15; }

.card-inner {
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 23px; display: flex; flex-direction: column; height: 100%; z-index: 1; position: relative;
    overflow: hidden;
}

.card-header { padding: 1.5rem 1.8rem; display: flex; align-items: center; gap: 1.2rem; }
.icon-wrapper {
    width: 48px; height: 48px; border-radius: 14px; background: var(--theme-grad);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.card-header h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.3px; }

.card-body { padding: 0 1.8rem 1.5rem; flex-grow: 1; display: flex; flex-direction: column; gap: 1.2rem; }
.flex-row { display: flex; gap: 1rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.input-group label { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.input-group input, .input-group select {
    width: 100%; padding: 0.9rem 1rem; background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; color: #fff;
    font-size: 1.05rem; font-weight: 500; outline: none; transition: all 0.2s;
}
.input-group input:focus, .input-group select:focus {
    border-color: rgba(255,255,255,0.3); background: rgba(0, 0, 0, 0.4);
}
.input-group select { appearance: none; cursor: pointer; }

/* Custom Radio Pills */
.radio-pill-group { display: flex; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 4px; }
.pill-btn {
    flex: 1; text-align: center; padding: 0.7rem; border-radius: 8px; cursor: pointer;
    font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); transition: all 0.3s;
}
input[type="radio"]:checked + .pill-btn { background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* BMI Bar */
.bmi-scale { width: 100%; }
.bmi-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #222; }
.bmi-segment { height: 100%; }

.mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 1rem; } .mb-2 { margin-bottom: 0.5rem; }
.calc-hint { font-size: 0.8rem; color: var(--text-placeholder); font-style: italic; }

.card-footer {
    padding: 1.5rem 1.8rem; background: rgba(0,0,0,0.25); border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 1.2rem; font-weight: 600; min-height: 5.5rem; display: flex; align-items: center; line-height: 1.4;
}
.placeholder-text { color: var(--text-placeholder); font-weight: 400; font-size: 0.95rem; }
.result-highlight { 
    color: #fff; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive */
@media (max-width: 1200px) {
    .sidebar { width: 90px; padding: 2rem 1rem; }
    .logo span, .nav-btn span, .sidebar-footer, .nav-divider { display: none; }
    .nav-btn { justify-content: center; padding: 1.2rem; }
    .nav-btn i { margin: 0; font-size: 1.4rem; }
    .main-content { margin-left: 90px; width: calc(100% - 90px); }
}
@media (max-width: 900px) {
    .top-header { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .header-right { width: 100%; flex-wrap: wrap; }
    .search-bar { width: 100%; }
}
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; display: none; /* Can make bottom nav later */ }
    .main-content { margin-left: 0; width: 100%; padding: 1.5rem; }
    .calculators-grid { grid-template-columns: 1fr; }
}
