/**
 * Sphere Volume Formula - Calculator UI Stylesheet
 * Focused, accessible, mobile-first interactive calculation engine
 */

.calc-hero-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin: 24px 0 40px;
}

@media (min-width: 768px) {
    .calc-hero-wrapper {
        padding: 32px;
    }
}

.calc-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 900px) {
    .calc-layout {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }
}

/* Calculator Header */
.calc-header {
    margin-bottom: 20px;
}

.calc-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.calc-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Mode Switcher (Radius vs Diameter) */
.calc-mode-switch {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #475569;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.mode-btn:hover {
    color: #0f172a;
}

.mode-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 700;
}

/* Form Inputs */
.calc-form-group {
    margin-bottom: 20px;
}

.calc-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.calc-input-row {
    display: flex;
    gap: 8px;
}

.calc-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.calc-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.calc-select {
    width: 110px;
    padding: 12px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    outline: none;
}

.calc-select:focus {
    border-color: var(--primary);
}

/* Calculator Actions */
.calc-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.calc-btn-calculate {
    flex: 2;
    padding: 14px 24px;
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
    transition: background-color 0.15s, transform 0.1s;
}

.calc-btn-calculate:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.calc-btn-clear {
    flex: 1;
    padding: 14px 16px;
    background: #f8fafc;
    color: #64748b;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calc-btn-clear:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

/* Results Section */
.calc-results-card {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
}

.calc-primary-result {
    text-align: center;
    padding: 16px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.result-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.result-value-display {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    word-break: break-all;
    line-height: 1.2;
}

.result-unit-tag {
    font-size: 1.2rem;
    font-weight: 600;
    color: #475569;
    margin-left: 6px;
}

/* Step-by-Step Breakdown */
.calc-steps-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 16px;
}

.steps-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-step-line {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: #334155;
    padding: 6px 0;
    border-bottom: 1px dashed #f1f5f9;
}

.calc-step-line:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--primary);
}

/* Unit Conversions Grid */
.calc-conversions {
    margin-top: 16px;
}

.conversions-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.conversions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.conv-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.conv-label {
    color: var(--text-muted);
    display: block;
}

.conv-val {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #0f172a;
}

/* Interactive SVG Sphere Graphic */
.calc-visual-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sphere-svg-container {
    width: 180px;
    height: 180px;
}

.sphere-dimension-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-top: 8px;
}
