/* ========================================
   PHYSICS TOPICS - EDUCATIONAL CONTENT
   In-depth guides with worked examples
======================================== */

/* Section Container */
.physics-topics-section {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 var(--gap-md);
}

.topics-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* Header */
.topics-header {
    padding: 2rem var(--gap-lg);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    text-align: center;
}

.topics-header h2 {
    font-size: 1.375rem;
    font-weight: 800;
    margin: 0 0 0.75rem 0;
}

.topics-header p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0;
    max-width: 700px;
    margin-inline: auto;
}

/* Topic Tabs */
.topic-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.topic-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.85rem 0.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    touch-action: manipulation;
}

.topic-tab i {
    font-size: 1rem;
}

.topic-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.topic-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

/* Topic Content */
.topic-content {
    display: none;
    padding: 1.5rem var(--gap-md);
}

.topic-content.active {
    display: block;
}

/* Topic Hero */
.topic-hero {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid #f1f5f9;
}

.topic-hero h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.topic-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Concept Block */
.concept-block {
    margin-bottom: 2rem;
}

.concept-block h4 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
}

.concept-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
}

.concept-block>p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 1rem 0;
}

/* Law Cards */
.law-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.law-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.law-card p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 0.75rem 0;
}

.law-card p:last-child {
    margin-bottom: 0;
}

/* Key Insight */
.key-insight {
    display: flex;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fcd34d;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.75rem 0;
}

.key-insight i {
    color: #d97706;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.key-insight span {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #78350f;
}

/* Formula Box */
.formula-box {
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    border: 2px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1rem 0;
    text-align: center;
}

.formula-main {
    font-size: 1.25rem;
    font-weight: 800;
    color: #3730a3;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.75rem;
}

.formula-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.formula-breakdown span {
    font-size: 0.75rem;
    color: #4338ca;
    font-family: 'Courier New', monospace;
}

/* Diagram Container */
.diagram-container {
    margin: 1.25rem 0;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.svg-diagram {
    background: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.physics-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.diagram-caption {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

/* Steps Summary */
.steps-summary {
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1rem 0;
}

.steps-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.step-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    align-items: flex-start;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: #16a34a;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.step-item span:last-child {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
}

/* Worked Examples */
.worked-example {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-xl);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.example-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 1rem 1.25rem;
}

.example-badge {
    display: inline-block;
    background: #f59e0b;
    color: #1e293b;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.example-header h5 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.example-problem {
    padding: 1.25rem;
    background: #fef2f2;
    border-bottom: 2px solid #fecaca;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #7f1d1d;
}

.example-solution {
    padding: 1.25rem;
}

.solution-step {
    margin-bottom: 1.25rem;
}

.solution-step:last-child {
    margin-bottom: 0;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e2e8f0;
}

.step-content {
    padding-left: 0.5rem;
}

.step-content p {
    font-size: 0.825rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 0.5rem 0;
}

.math-line {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1e293b;
    padding: 0.3rem 0;
    line-height: 1.5;
}

.result-highlight {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-weight: 700;
    color: #166534;
    display: inline-block;
    margin: 0.25rem 0;
}

.example-answer {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-top: 2px solid #bae6fd;
    font-size: 0.825rem;
    line-height: 1.6;
    color: #0c4a6e;
}

/* Equations Table */
.equations-table {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 1rem 0;
}

.equation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.equation-row:last-child {
    border-bottom: none;
}

.equation-row:nth-child(even) {
    background: #f8fafc;
}

.equation-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}

.equation-note {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Two Column Info */
.two-column-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.info-column {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.info-column-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.info-column p {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 0.5rem 0;
}

.info-column .math-line {
    font-size: 0.8rem;
}

/* Comparison Table */
.comparison-table {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 1rem 0;
    font-size: 0.75rem;
}

.comparison-header {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    background: #1e293b;
}

.head-cell {
    color: white !important;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    border-bottom: 1px solid #f1f5f9;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-row:nth-child(even) {
    background: #f8fafc;
}

.comparison-cell {
    padding: 0.6rem 0.5rem;
    color: #475569;
    font-size: 0.7rem;
    line-height: 1.4;
}

.label-cell {
    font-weight: 700;
    color: #1e293b;
}

/* Circuit Diagram */
.circuit-diagram-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1rem 0;
}

.circuit-diagram-box h5 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.5rem 0;
}

.circuit-ascii {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #1e293b;
    white-space: pre;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.circuit-note {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (min-width: 576px) {
    .topic-tabs {
        grid-template-columns: repeat(6, 1fr);
    }

    .topic-tab {
        font-size: 0.6rem;
        padding: 0.75rem 0.25rem;
    }

    .two-column-info {
        grid-template-columns: 1fr 1fr;
    }

    .topic-content {
        padding: 2rem 1.5rem;
    }

    .topic-hero h3 {
        font-size: 1.375rem;
    }
}

@media (min-width: 768px) {
    .physics-topics-section {
        max-width: 800px;
    }

    .topics-header h2 {
        font-size: 1.5rem;
    }

    .topic-tab {
        font-size: 0.65rem;
        padding: 1rem 0.5rem;
    }

    .topic-tab i {
        font-size: 1.1rem;
    }

    .formula-main {
        font-size: 1.375rem;
    }
}

@media (min-width: 1024px) {
    .physics-topics-section {
        max-width: 900px;
    }

    .topic-content {
        padding: 2rem;
    }

    .worked-example {
        margin-bottom: 2rem;
    }
}

/* Print */
@media print {
    .topic-tabs {
        display: none;
    }

    .topic-content {
        display: block !important;
        break-inside: avoid;
    }

    .worked-example {
        break-inside: avoid;
    }
}