/**
 * Corporate Finance Study App Styles
 * Extends glassmorphic-theme.css
 */

/* ===== App Layout ===== */
.c214-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 80px);
}

/* ===== Tab Navigation ===== */
.c214-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.c214-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary, #666);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.c214-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary, #333);
}

.c214-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Panel Layout ===== */
.c214-content {
    position: relative;
}

.c214-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.c214-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }
}

/* Practice Calculator Sidebar */
.practice-calc-sidebar {
    position: sticky;
    top: 1rem;
}

@media (max-width: 1200px) {
    .practice-calc-sidebar {
        display: none; /* Use floating button on tablet/mobile */
    }
}

/* ===== Calculator Styles ===== */
.calculator-container {
    display: flex;
    justify-content: center;
}

.calculator {
    width: 380px;
    background: linear-gradient(145deg, #d4c4a8, #c8b898);
    border-radius: 16px;
    padding: 1rem;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem 0.75rem;
    font-family: 'Share Tech Mono', monospace;
}

.calc-brand {
    font-size: 0.65rem;
    color: #4a4a4a;
    letter-spacing: 1px;
}

.calc-model {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2a2a2a;
}

/* LCD Display */
.calc-display {
    background: linear-gradient(145deg, #a8b898, #b8c8a8);
    border: 3px solid #6a7a5a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.display-indicators {
    display: flex;
    gap: 1rem;
    font-size: 0.65rem;
    font-family: 'Share Tech Mono', monospace;
    color: #2a3a2a;
    margin-bottom: 0.25rem;
}

.indicator {
    opacity: 0.2;
    transition: opacity 0.2s;
}

.indicator.active {
    opacity: 1;
}

.display-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.25rem;
    text-align: right;
    color: #1a2a1a;
    letter-spacing: 2px;
    min-height: 2.75rem;
    overflow: hidden;
}

.display-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    text-align: right;
    color: #3a4a3a;
    min-height: 1rem;
}

/* Button Grid */
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    row-gap: 18px;
    padding-top: 8px;
}

.calc-btn {
    position: relative;
    padding: 10px 4px;
    border: none;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.calc-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.calc-btn:hover {
    filter: brightness(1.1);
}

/* Button Types */
.btn-number {
    background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
    color: white;
}

.btn-tvm {
    background: linear-gradient(145deg, #5a7a9a, #4a6a8a);
    color: white;
}

.btn-function {
    background: linear-gradient(145deg, #6a8a7a, #5a7a6a);
    color: white;
}

.btn-operator {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    color: white;
}

.btn-2nd {
    background: linear-gradient(145deg, #d4782a, #c46820);
    color: white;
}

.btn-memory {
    background: linear-gradient(145deg, #6a6a6a, #5a5a5a);
    color: white;
}

.btn-nav {
    background: linear-gradient(145deg, #5a5a5a, #4a4a4a);
    color: white;
}

.btn-enter {
    background: linear-gradient(145deg, #5a7a6a, #4a6a5a);
    color: white;
}

.btn-compute {
    background: linear-gradient(145deg, #2a5a8a, #1a4a7a);
    color: white;
}

.btn-clear {
    background: linear-gradient(145deg, #8a5a5a, #7a4a4a);
    color: white;
}

.btn-equals {
    background: linear-gradient(145deg, #4a6a8a, #3a5a7a);
    color: white;
}

/* 2nd Function Labels */
.btn-2nd-label {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: #e8954a;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

.btn-primary {
    display: block;
}

/* 2nd Mode Active */
.calculator.second-mode .btn-2nd-label {
    color: #ffdd44;
    text-shadow: 0 0 6px rgba(255, 221, 68, 0.8);
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.calculator.second-mode .btn-2nd {
    box-shadow:
        0 3px 6px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 204, 0, 0.5);
}

/* Highlighted Button (for tutorials) */
.calc-btn.highlight {
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); }
}

/* ===== Calculator Help Panel ===== */
.calc-help {
    padding: 1.5rem;
    font-size: 0.9rem;
}

.calc-help h3 {
    margin-bottom: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
}

.help-section {
    margin-bottom: 1.25rem;
}

.help-section h4 {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-section li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.help-section code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===== Practice Section ===== */
.practice-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}

.topic-selector label {
    font-weight: 500;
    font-size: 0.9rem;
}

.glass-select {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.glass-input {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

.glass-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Problem Card */
.problem-card {
    padding: 1.5rem;
}

.problem-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.problem-number {
    font-weight: 600;
}

.problem-topic {
    background: rgba(102, 126, 234, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.problem-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.problem-difficulty[data-level="basic"] {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.problem-difficulty[data-level="intermediate"] {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.problem-difficulty[data-level="advanced"] {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.problem-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.problem-answer {
    margin-top: 1rem;
}

.problem-answer label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.answer-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.currency-prefix {
    font-size: 1.25rem;
    color: var(--text-secondary, #666);
}

.answer-input-group input {
    max-width: 300px;
}

.answer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Feedback */
.problem-feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
}

.problem-feedback.correct {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.problem-feedback.incorrect {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.feedback-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Solution Steps */
.solution-steps {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.solution-steps h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.solution-step {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    align-items: start;
}

.step-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.step-explanation {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
}

.step-formula {
    font-family: 'Share Tech Mono', monospace;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.step-calculator {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calc-key-badge {
    background: #4a6a8a;
    color: white;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
}

/* Problem Navigation */
.problem-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.problem-counter {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    font-family: 'Share Tech Mono', monospace;
}

@media (max-width: 600px) {
    .problem-nav {
        justify-content: center;
    }

    .problem-counter {
        width: 100%;
        text-align: center;
        order: -1;
    }
}

.hint-text {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 1rem;
}

/* ===== Formula Section ===== */
.formulas-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.formula-search {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.formula-search input {
    flex: 1;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.formula-card {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.formula-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.formula-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.formula-name {
    font-weight: 600;
    font-size: 1rem;
}

.formula-bookmark {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.formula-bookmark:hover,
.formula-bookmark.active {
    opacity: 1;
}

.formula-equation {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    text-align: center;
}

.formula-variables {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 0.75rem;
}

.formula-variables dt {
    font-weight: 500;
    color: var(--text-primary, #333);
}

.formula-variables dd {
    margin-left: 1rem;
    margin-bottom: 0.25rem;
}

.formula-calc-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Progress Section ===== */
.progress-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.progress-overview {
    grid-column: 1 / -1;
    padding: 1.5rem;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-around;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-mastery {
    padding: 1.5rem;
}

.mastery-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.mastery-bar {
    display: grid;
    grid-template-columns: 150px 1fr 50px;
    gap: 1rem;
    align-items: center;
}

.mastery-topic {
    font-size: 0.9rem;
    font-weight: 500;
}

.mastery-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.mastery-percent {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.recent-activity {
    padding: 1.5rem;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.activity-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-empty {
    color: var(--text-secondary, #666);
    font-style: italic;
}

.progress-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.glass-button-danger {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.3);
}

.glass-button-danger:hover {
    background: rgba(244, 67, 54, 0.3);
}

/* ===== Study Guide Section ===== */
.guide-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.guide-intro {
    padding: 1.5rem;
}

.guide-intro h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.guide-intro p {
    color: var(--text-secondary, #666);
    line-height: 1.6;
}

.topic-tree {
    padding: 1.5rem;
}

.topic-list {
    margin-top: 1rem;
}

.topic-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.topic-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.topic-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.topic-toggle {
    font-size: 1.2rem;
    color: var(--text-secondary, #666);
    transition: transform 0.2s;
    margin-left: auto;
}

.topic-item.expanded .topic-toggle {
    transform: rotate(45deg);
}

.topic-tree-hint {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-bottom: 1rem;
}

/* Topic Content (expandable) */
.topic-content {
    display: none;
    padding: 1rem 1rem 1rem 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.2s ease;
}

.topic-item.expanded .topic-content {
    display: block;
}

.topic-summary {
    margin-bottom: 1rem;
}

.topic-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-summary li {
    padding: 0.4rem 0;
    padding-left: 1rem;
    border-left: 3px solid #667eea;
    margin-bottom: 0.5rem;
    color: var(--text-secondary, #666);
}

.topic-formulas,
.topic-tips {
    margin-bottom: 1rem;
}

.topic-formulas h5,
.topic-tips h5 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.topic-formulas ul,
.topic-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-formulas li {
    padding: 0.3rem 0;
    font-family: 'Share Tech Mono', monospace;
}

.topic-formulas code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.topic-tips li {
    font-size: 0.9rem;
    padding: 0.4rem 0;
    padding-left: 1rem;
    border-left: 2px solid #4caf50;
    margin-bottom: 0.3rem;
    color: var(--text-secondary, #666);
}

.topic-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.topic-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.topic-status.completed {
    background: #4caf50;
    border-color: #4caf50;
}

.topic-status.in-progress {
    background: #ffc107;
    border-color: #ffc107;
}

.topic-name {
    flex: 1;
    font-weight: 500;
}

.topic-weight {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.topic-children {
    padding: 0.5rem 1rem 1rem 3rem;
}

.subtopic {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subtopic:last-child {
    border-bottom: none;
}

.guide-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
}

/* ===== Floating Calculator Button ===== */
.floating-calc-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 100;
    transition: transform 0.2s;
}

.floating-calc-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .floating-calc-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== Calculator Overlay ===== */
.calc-overlay {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 200;
    max-height: 90vh;
    overflow-y: auto;
}

.calc-overlay.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.calc-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.close-overlay-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
}

.close-overlay-btn:hover {
    opacity: 1;
}

.calc-overlay-content {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .c214-app {
        padding: 0.5rem;
    }

    .c214-tabs {
        padding: 0.5rem;
    }

    .c214-tab {
        padding: 0.5rem 1rem;
    }

    .tab-label {
        display: none;
    }

    .tab-icon {
        font-size: 1.25rem;
    }

    .calculator {
        width: 100%;
        max-width: 380px;
    }

    .calc-help {
        display: none;
    }

    .formula-grid {
        grid-template-columns: 1fr;
    }

    .solution-step {
        grid-template-columns: 1fr;
    }

    .step-number {
        margin-bottom: 0.5rem;
    }
}

/* ===== Dark Mode Overrides ===== */
/* Note: JavaScript uses body.dark-mode class, not data-theme attribute */

body.dark-mode .calculator {
    background: linear-gradient(145deg, #3a3830, #2a2820);
}

body.dark-mode .calc-display {
    background: linear-gradient(145deg, #1a2a1a, #2a3a2a);
    border-color: #3a4a3a;
}

body.dark-mode .display-value {
    color: #b8c8a8;
}

body.dark-mode .display-indicators {
    color: #8a9a8a;
}

body.dark-mode .calc-brand,
body.dark-mode .calc-model {
    color: #ccc;
}

/* ===== Glass Button Styles (if not in theme) ===== */
.glass-button,
.glass-button-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.glass-button-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.glass-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ===== Disabled Button Styles ===== */
.glass-button:disabled,
.glass-button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.glass-button:disabled:hover,
.glass-button-primary:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
    box-shadow: none;
}

.glass-button-primary:disabled:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* ===== Formula Card Additional Styles ===== */
.formula-example {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
}

.formula-example strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #4caf50;
}

.formula-notes {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    font-style: italic;
    padding: 0.5rem;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
}

/* ===== Extended Dark Mode Support ===== */
body.dark-mode .c214-tab {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

body.dark-mode .c214-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

body.dark-mode .problem-feedback {
    background: rgba(40, 40, 40, 0.9);
    color: #e0e0e0;
}

body.dark-mode .problem-feedback.correct {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}

body.dark-mode .problem-feedback.incorrect {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

body.dark-mode .formula-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .formula-equation {
    background: rgba(102, 126, 234, 0.15);
}

body.dark-mode .formula-example {
    background: rgba(76, 175, 80, 0.15);
}

body.dark-mode .formula-notes {
    background: rgba(255, 193, 7, 0.15);
}

body.dark-mode .mastery-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .stat-label,
body.dark-mode .formula-variables,
body.dark-mode .formula-notes {
    color: #aaa;
}

body.dark-mode .glass-card {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .glass-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .glass-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .solution-step {
    background: rgba(255, 255, 255, 0.03);
}

/* Additional dark mode text overrides */
body.dark-mode .glass-input,
body.dark-mode .glass-select {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .glass-input::placeholder {
    color: #888;
}

body.dark-mode .step-explanation,
body.dark-mode .subtopic,
body.dark-mode .currency-prefix,
body.dark-mode .problem-counter {
    color: #aaa;
}

body.dark-mode .formula-name,
body.dark-mode .calc-help h3,
body.dark-mode .topic-selector label {
    color: #e0e0e0;
}

body.dark-mode .help-section code {
    background: rgba(102, 126, 234, 0.2);
    color: #b8c8ff;
}

/* Light mode input improvements */
.glass-input,
.glass-select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===== Multiple Choice Options ===== */
.mc-options-container {
    margin-top: 1rem;
}

.mc-instruction {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary, #666);
}

.mc-option {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
}

.mc-option:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.mc-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.mc-option.correct {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
}

.mc-option.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.15);
}

.mc-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.mc-option.correct .mc-letter {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.mc-option.incorrect .mc-letter {
    background: linear-gradient(135deg, #f44336, #c62828);
}

.mc-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
}

/* Dark mode MC adjustments */
body.dark-mode .mc-option {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mc-option:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

body.dark-mode .mc-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

body.dark-mode .mc-option.correct {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

body.dark-mode .mc-option.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.2);
}

body.dark-mode .mc-instruction {
    color: #aaa;
}

/* Responsive MC adjustments */
@media (max-width: 600px) {
    .mc-option {
        padding: 0.75rem;
    }

    .mc-letter {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        margin-right: 0.75rem;
    }

    .mc-value {
        font-size: 1rem;
    }
}
