/* ============================================
   SEMICONDUCTOR SIMULATION — DESIGN SYSTEM
   Premium Dark Theme with Glassmorphism
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-cyan: #22d3ee;
    --accent-green: #34d399;
    --accent-red: #f87171;
    --accent-amber: #fbbf24;
    --accent-pink: #f472b6;

    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --gradient-ntype: linear-gradient(135deg, #1e3a5f, #1e40af);
    --gradient-ptype: linear-gradient(135deg, #5b2145, #7e22ce);

    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(96, 165, 250, 0.3);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(96, 165, 250, 0.15);
    --shadow-glow-purple: 0 0 30px rgba(167, 139, 250, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 1000;
    width: 0%;
    transition: width 0.15s linear;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-glass-hover);
}

.nav-list {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(96, 165, 250, 0.12);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
}

/* ---------- Mobile Header ---------- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 800;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.mobile-title {
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 850;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-smooth);
}

/* ---------- Section Layout ---------- */
.section {
    min-height: 100vh;
    padding: 80px 40px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 48px;
    text-align: center;
}

.section-number {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-blue);
    background: rgba(96, 165, 250, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ---------- Hero Section ---------- */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gradient-hero);
    padding: 60px 40px;
    opacity: 1;
    transform: none;
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 750px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-blue);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 36px;
    animation: fadeInUp 0.6s ease 0.6s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 36px;
    animation: fadeInUp 0.6s ease 0.8s both;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 28px;
    backdrop-filter: blur(10px);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glow);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeInUp 0.6s ease 1s both;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(96, 165, 250, 0.3);
}

/* ---------- Info Grid ---------- */
.info-grid {
    display: grid;
    gap: 24px;
}

.info-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.info-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(10px);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow-blue);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.formula-box {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-gold {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-amber);
}

.tag-blue {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-blue);
}

.tag-red {
    background: rgba(248, 113, 113, 0.15);
    color: var(--accent-red);
}

/* ---------- Content Split ---------- */
.content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.concept-block h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-blue);
}

.concept-block p {
    color: var(--text-secondary);
    font-size: 0.93rem;
    margin-bottom: 8px;
}

/* ---------- Band Info Cards ---------- */
.band-info-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.band-card {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.valence-band-card {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--accent-red);
}

.conduction-band-card {
    background: rgba(96, 165, 250, 0.08);
    border-color: var(--accent-blue);
}

.gap-band-card {
    background: rgba(251, 191, 36, 0.08);
    border-color: var(--accent-amber);
}

.band-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.band-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.formula-highlight {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--accent-cyan);
    margin: 8px 0;
}

/* ---------- Simulation Box ---------- */
.sim-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: sticky;
    top: 80px;
}

.sim-box.compact-sim {
    max-width: 700px;
    margin: 40px auto 0;
    position: relative;
    top: auto;
}

.sim-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-purple);
}

.sim-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.sim-box canvas {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
    display: block;
    cursor: pointer;
}

.sim-controls {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sim-readout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-green);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ---------- Styled Slider ---------- */
.slider-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label>span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.styled-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
    cursor: grab;
    transition: transform var(--transition-fast);
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.styled-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: none;
    cursor: grab;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---------- Sim Button ---------- */
.sim-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gradient-primary);
    color: white;
}

.sim-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.sim-btn.btn-secondary {
    background: var(--bg-glass-hover);
    color: var(--text-secondary);
}

.sim-btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    box-shadow: none;
}

.toggle-group {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.toggle-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: white;
}

/* ---------- Comparison Table ---------- */
.comparison-table-wrap {
    overflow-x: auto;
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.comparison-table thead th {
    background: rgba(96, 165, 250, 0.08);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.col-conductor {
    color: var(--accent-amber) !important;
}

.col-insulator {
    color: var(--accent-red) !important;
}

.col-semi {
    color: var(--accent-blue) !important;
}

.comparison-table td {
    color: var(--text-secondary);
}

.prop-name {
    font-weight: 600;
    color: var(--text-primary) !important;
}

.comparison-table tbody tr:hover {
    background: var(--bg-glass-hover);
}

/* ---------- Band Diagrams ---------- */
.band-diagram-visual {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.band-diagram {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: transform var(--transition-fast);
}

.band-diagram:hover {
    transform: translateY(-4px);
}

.band-diagram h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-blue);
}

.band-diagram canvas {
    display: block;
    border-radius: var(--radius-sm);
}

.diagram-label {
    display: block;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

/* ---------- Fermi Section ---------- */
.fermi-content {
    max-width: 800px;
    margin: 0 auto;
}

.highlight-card {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 32px;
}

.glow-card {
    box-shadow: var(--shadow-glow-purple);
    border-color: rgba(167, 139, 250, 0.2);
}

.highlight-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.highlight-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.highlight-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.styled-list {
    list-style: none;
    padding: 0;
}

.styled-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.styled-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 600;
}

/* ---------- Dopant Cards ---------- */
.dopant-cards {
    display: flex;
    gap: 16px;
}

.dopant-card {
    flex: 1;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.donor-card {
    background: rgba(96, 165, 250, 0.06);
    border-color: rgba(96, 165, 250, 0.15);
}

.acceptor-card {
    background: rgba(244, 114, 182, 0.06);
    border-color: rgba(244, 114, 182, 0.15);
}

.dopant-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dopant-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.element-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.elem {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.arrow-result {
    font-size: 0.88rem;
    color: var(--accent-green);
    font-weight: 500;
}

/* ---------- Tree Diagram ---------- */
.tree-diagram {
    margin-top: 24px;
    text-align: center;
}

.tree-root {
    display: inline-block;
    padding: 10px 24px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    position: relative;
}

.tree-root::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 50%;
    width: 2px;
    height: 24px;
    background: var(--border-subtle);
}

.tree-branches {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding-top: 24px;
    position: relative;
}

.tree-branches::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--border-subtle);
}

.tree-branch {
    text-align: center;
}

.tree-node {
    display: inline-block;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 16px;
    position: relative;
}

.tree-node::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 50%;
    width: 2px;
    height: 24px;
    background: var(--border-subtle);
}

.intrinsic-node {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
}

.extrinsic-node {
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent-purple);
}

.tree-leaf {
    padding: 10px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.tree-sub-branches {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.ntype-leaf {
    border-color: rgba(96, 165, 250, 0.2);
}

.ptype-leaf {
    border-color: rgba(244, 114, 182, 0.2);
}

/* ---------- N-type / P-type Cards ---------- */
.ntype-card {
    border-top: 3px solid var(--accent-blue);
}

.ptype-card {
    border-top: 3px solid var(--accent-pink);
}

.card-header-accent {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.ntype-accent {
    color: var(--accent-blue);
}

.ptype-accent {
    color: var(--accent-pink);
}

.carrier-info {
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.carrier {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.carrier-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.electron-dot {
    background: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
}

.hole-dot {
    background: var(--accent-pink);
    box-shadow: 0 0 6px var(--accent-pink);
}

.detail-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.equilibrium-note {
    text-align: center;
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.equilibrium-note p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ---------- Bias Cards ---------- */
.bias-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bias-card {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.forward-bias-card {
    background: rgba(52, 211, 153, 0.05);
    border-color: rgba(52, 211, 153, 0.15);
}

.reverse-bias-card {
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.15);
}

.bias-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.forward-bias-card h3 {
    color: var(--accent-green);
}

.reverse-bias-card h3 {
    color: var(--accent-red);
}

.bias-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ---------- Diode Info ---------- */
.diode-info {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.diode-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 8px;
}

.diode-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.diode-symbol {
    text-align: center;
    padding: 8px 0;
}

.highlight-hole {
    color: var(--accent-pink);
}

.highlight-electron {
    color: var(--accent-blue);
}

/* ---------- Formula Reference Grid ---------- */
.formula-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.formula-ref-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.formula-ref-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
}

.formula-ref-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 8px;
}

.formula-ref-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---------- Rectifier Diagrams ---------- */
.rectifier-diagram {
    margin-bottom: 16px;
}

.rectifier-diagram canvas {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 1024px) {
    .formula-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .formula-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Footer ---------- */
.lesson-footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.footer-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-brand {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-seo {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.15);
    margin-top: 16px;
    letter-spacing: 0.5px;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .content-split {
        grid-template-columns: 1fr;
    }

    .sim-box {
        position: relative;
        top: auto;
    }

    .info-grid.three-col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .section {
        padding: 80px 20px 40px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .info-grid.three-col,
    .info-grid.two-col {
        grid-template-columns: 1fr;
    }

    .band-diagram-visual {
        flex-direction: column;
        align-items: center;
    }

    .dopant-cards {
        flex-direction: column;
    }

    .tree-branches {
        flex-direction: column;
        gap: 24px;
    }

    .highlight-card {
        flex-direction: column;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px;
    }
}