/* ======================================================
   S4Skill — Online Calculators Section Stylesheet
   Author: Antigravity / Sazzad Hossain
   Version: 1.0.0
====================================================== */

.calculators-layout {
    margin-top: 2rem;
}

/* Sidebar navigation styling matching tools.css but distinct */
.calc-nav-card {
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.calc-category-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}
.calc-category-title:first-child {
    margin-top: 0;
}

.calc-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.calc-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
}

.calc-nav-item a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.1);
    transform: translateX(3px);
}

.calc-nav-item.active a {
    color: #fff !important;
    background: var(--grad-primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.calc-nav-item i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}

/* Premium formula display box */
.formula-display-card {
    background: rgba(99, 102, 241, 0.03);
    border: 1px dashed rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.formula-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.formula-latex {
    font-family: 'Cambria Math', 'Georgia', serif;
    font-size: 1.8rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.formula-calculation {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.2);
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Visual Panel Layout */
.calculator-visual-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card-2);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

/* Specific Interactive Visuals */

/* BMI gauge */
.bmi-gauge-container {
    width: 200px;
    height: 100px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.bmi-gauge-arc {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 20px solid transparent;
    border-top: 20px solid var(--border-color);
    position: absolute;
    top: 0;
    left: 0;
}

.bmi-gauge-colored-arc {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 20px solid transparent;
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-45deg);
    /* Set color stops for BMI: Underweight (blue), Normal (green), Overweight (orange), Obese (red) */
    background: conic-gradient(from 180deg, #3b82f6 0deg, #10b981 45deg, #f59e0b 90deg, #ef4444 135deg);
    -webkit-mask: radial-gradient(circle, transparent 58%, black 60%);
    mask: radial-gradient(circle, transparent 58%, black 60%);
}

.bmi-gauge-needle {
    width: 6px;
    height: 90px;
    background: var(--text-primary);
    position: absolute;
    bottom: 0;
    left: calc(50% - 3px);
    transform-origin: bottom center;
    border-radius: 4px;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.bmi-gauge-center {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border: 4px solid var(--bg-card);
    border-radius: 50%;
    position: absolute;
    bottom: -12px;
    left: calc(50% - 12px);
    box-shadow: var(--shadow-sm);
}

/* Water glass visual */
.water-glass-visual {
    width: 120px;
    height: 200px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.water-fill {
    width: 100%;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0%;
    transition: height 0.8s ease;
    box-shadow: inset 0 10px 20px rgba(255, 255, 255, 0.3);
}

.water-wave {
    position: absolute;
    top: -10px;
    left: 0;
    width: 200%;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 40%;
    animation: water-wave-anim 4s infinite linear;
}

@keyframes water-wave-anim {
    0% { transform: translateX(0) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* Force / Density / Speed simulation boxes */
.simulation-track {
    width: 100%;
    height: 120px;
    border-bottom: 3px solid var(--border-color);
    position: relative;
    margin-top: 2rem;
}

.simulated-object {
    width: 60px;
    height: 60px;
    background: var(--grad-primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    position: absolute;
    bottom: 0;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.density-beaker {
    width: 150px;
    height: 200px;
    border: 4px solid var(--border-color);
    border-top: none;
    background: rgba(255,255,255,0.02);
    position: relative;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.density-liquid {
    width: 100%;
    height: 70%;
    background: rgba(96, 165, 250, 0.4);
    position: absolute;
    bottom: 0;
    left: 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top: 2px solid #60a5fa;
}

.density-object {
    width: 40px;
    height: 40px;
    background: #f59e0b;
    border: 2px solid #d97706;
    position: absolute;
    left: calc(50% - 20px);
    transition: bottom 1s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #000;
}

/* Equation solver coordinate system */
.coordinate-system {
    width: 240px;
    height: 240px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    position: relative;
}

.coordinate-axis-x {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.4);
    position: absolute;
    top: 50%;
    left: 0;
}

.coordinate-axis-y {
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.4);
    position: absolute;
    left: 50%;
    top: 0;
}

.coordinate-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Study time planner scheduling visuals (inspired by Ohm's Law) */
.study-planner-container {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.study-visual-timeline {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: var(--radius-sm);
    position: relative;
}

.study-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.study-milestone-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border-color);
    border: 3px solid var(--bg-card);
    transition: var(--transition);
}

.study-milestone.active .study-milestone-dot {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.study-timeline-line {
    position: absolute;
    height: 4px;
    background: var(--border-color);
    left: 10%;
    right: 10%;
    top: calc(1rem + 6px);
    z-index: 1;
}

.study-timeline-fill {
    position: absolute;
    height: 4px;
    background: var(--grad-primary);
    left: 10%;
    width: 0%;
    top: calc(1rem + 6px);
    z-index: 1;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.study-clock-face {
    width: 80px;
    height: 80px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    position: relative;
}

.study-clock-hand {
    width: 3px;
    height: 30px;
    background: var(--accent);
    position: absolute;
    bottom: 50%;
    left: calc(50% - 1.5px);
    transform-origin: bottom center;
    animation: rotate-clock-hand 10s infinite linear;
}

@keyframes rotate-clock-hand {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Simple retro calculator styling */
.retro-calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 220px;
    background: rgba(0,0,0,0.3);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.retro-calc-screen {
    grid-column: span 4;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #10b981;
    font-family: monospace;
    font-size: 1.5rem;
    padding: 0.5rem;
    text-align: right;
    min-height: 45px;
    word-break: break-all;
}

.retro-calc-btn {
    padding: 0.6rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.retro-calc-btn:hover {
    background: var(--grad-primary);
    color: #fff;
}
.retro-calc-btn.operator {
    color: var(--primary);
}
.retro-calc-btn.equal {
    background: var(--primary);
    color: #fff;
    grid-column: span 2;
}

/* Donut chart for loans */
.loan-chart-donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0% 70%, var(--accent) 70% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loan-chart-donut-inner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-card-2);
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .calc-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    .calc-nav-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.75rem;
    }
    .calc-nav-item a {
        white-space: nowrap;
    }
    .calc-category-title {
        display: none;
    }
}

/* Custom number input next to range sliders */
.range-input-field {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100px;
    text-align: right;
    outline: none;
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.range-input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
    background: rgba(30, 41, 59, 0.9);
}

/* Remove number spin buttons */
.range-input-field::-webkit-outer-spin-button,
.range-input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.range-input-field[type=number] {
    -moz-appearance: textfield;
}

