/* ===== CSS Variables (Kiro-inspired) ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #8b5cf6;
    --accent-secondary: #6366f1;
    --accent-tertiary: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border-color: #2a2a3a;
    --border-radius: 12px;
    --border-radius-lg: 20px;

    --shadow-sm: 0 2px 8px 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: 0 0 40px rgba(139, 92, 246, 0.3);

    --transition: all 0.3s ease;
    --font-thai: 'IBM Plex Sans Thai', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-thai);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.3;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
}

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

.logo-icon-svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-thai);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ===== Hero Stats ===== */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Features Section ===== */
.features {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Chapters Section ===== */
.chapters {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.chapters-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.part {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.part-header {
    margin-bottom: 30px;
}

.part-number {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-gradient);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.part-title {
    font-size: 1.5rem;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chapter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.chapter-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.chapter-card:hover::before {
    opacity: 1;
}

.chapter-number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0.5;
    margin-bottom: 12px;
}

.chapter-card h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.chapter-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.chapter-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chapter-tag.safety {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ===== Calculator Section ===== */
.calculator-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.calculator-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.calc-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-thai);
    font-size: 1rem;
}

.calc-tab:hover {
    background: var(--bg-card-hover);
}

.calc-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.calculator-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
}

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

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

.calc-inputs h3,
.calc-results h3 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-thai);
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input-group .hidden {
    display: none;
    margin-top: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 16px;
}

.result-card.highlight {
    background: var(--accent-gradient);
    margin-bottom: 24px;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.result-card.highlight .result-label {
    color: rgba(255, 255, 255, 0.8);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.result-card.highlight .result-value {
    font-size: 2rem;
}

.result-note {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-note strong {
    color: var(--warning);
}

/* Wire Table */
.wire-table {
    margin-top: 24px;
}

.wire-table table {
    width: 100%;
    border-collapse: collapse;
}

.wire-table th,
.wire-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.wire-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
}

.wire-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ===== Safety Section ===== */
.safety-section {
    padding: 100px 0;
}

.safety-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 60px;
    text-align: center;
}

.safety-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.safety-card h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.safety-card>p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    text-align: left;
    margin-bottom: 40px;
}

.safety-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
}

.safety-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.safety-item.danger .safety-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.safety-item.warning .safety-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.safety-item.success .safety-badge {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.safety-item ul {
    list-style: none;
}

.safety-item li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-left: 20px;
    position: relative;
}

.safety-item li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.emergency-numbers {
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 10px;
    display: inline-block;
    font-size: 0.95rem;
}

.emergency-numbers strong {
    color: var(--danger);
}

/* ===== Footer ===== */
.footer {
    padding: 60px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger);
}

.modal-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-chapter-num {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    opacity: 0.5;
}

.modal-title {
    font-size: 1.8rem;
    margin-top: 8px;
}

.modal-body {
    padding: 40px;
    line-height: 1.8;
}

.modal-body h3 {
    font-size: 1.3rem;
    margin: 32px 0 16px;
    color: var(--accent-primary);
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.modal-body ul,
.modal-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.modal-body li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.modal-body th,
.modal-body td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.modal-body th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body .warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin: 24px 0;
}

.modal-body .info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin: 24px 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 2rem;
    }

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

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

    .part {
        padding: 24px;
    }

    .safety-card {
        padding: 40px 24px;
    }

    .modal-header,
    .modal-body {
        padding: 24px;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ===== Selection ===== */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* Chapter Images */
.chapter-image {
    margin: 1.5rem 0;
    text-align: center;
}

.chapter-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 0.5rem;
}

.chapter-image figcaption {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 
===== Checklist Section ===== */
.checklist-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.checklist-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.checklist-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-thai);
    font-size: 1rem;
}

.checklist-tab:hover {
    background: var(--bg-card-hover);
}

.checklist-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.checklist-panel {
    display: none;
}

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

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.checklist-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.checklist-card.full-width {
    grid-column: 1 / -1;
}

.checklist-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.checklist-item:hover {
    background: var(--bg-tertiary);
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.checklist-item span {
    color: var(--text-secondary);
    transition: var(--transition);
}

.checklist-item input:checked + span {
    color: var(--success);
    text-decoration: line-through;
}

.checklist-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ===== Guide Section ===== */
.guide-section {
    padding: 100px 0;
}

.guide-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.guide-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.guide-step {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.step-details p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.step-details ul,
.step-details ol {
    margin-bottom: 16px;
    padding-left: 20px;
}

.step-details li {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.step-details li strong {
    color: var(--text-primary);
}

.step-table {
    margin: 16px 0;
    overflow-x: auto;
}

.step-table table {
    width: 100%;
    border-collapse: collapse;
}

.step-table th,
.step-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.9rem;
}

.step-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.step-table td {
    color: var(--text-secondary);
}

.step-tip {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.step-tip strong {
    color: var(--accent-tertiary);
}

.step-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.step-warning strong {
    color: var(--warning);
}

.step-order {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.order-num {
    width: 28px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

/* Responsive for Guide */
@media (max-width: 768px) {
    .guide-timeline::before {
        left: 20px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .guide-step {
        gap: 16px;
    }

    .step-content {
        padding: 16px;
    }
}


/* ===== Quick Reference Section ===== */
.reference-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.ref-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-thai);
}

.ref-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.ref-icon {
    font-size: 2rem;
}

.ref-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ref-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .hero,
    .features,
    .chapters,
    .calculator-section,
    .guide-section,
    .safety-section,
    .reference-section,
    .footer,
    .checklist-tabs,
    .checklist-progress,
    button {
        display: none !important;
    }

    .checklist-section {
        padding: 0;
        background: white;
    }

    .checklist-panel {
        display: block !important;
        page-break-after: always;
    }

    .checklist-card {
        background: white;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }

    .checklist-item {
        color: black !important;
    }

    .checklist-item span {
        color: black !important;
    }
}


/* ===== Checklist Actions ===== */
.checklist-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.checklist-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}


/* ===== Calculator Improvements ===== */
.calc-examples {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.examples-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.example-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-thai);
}

.example-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-presets {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.input-presets button {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-thai);
}

.input-presets button:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-large {
    padding: 16px 28px;
    font-size: 1.1rem;
}

.custom-cell-inputs {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 8px;
}

.custom-cell-inputs.hidden {
    display: none;
}

.custom-cell-inputs label {
    display: block;
    margin-bottom: 6px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.custom-cell-inputs label:first-child {
    margin-top: 0;
}

/* ===== FAQ Section ===== */
.faq-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-thai);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-answer-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.faq-answer-content li {
    margin-bottom: 8px;
}

.faq-answer-content strong {
    color: var(--text-primary);
}

.faq-answer-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ===== Calculator Enhancements ===== */

/* Input Hints */
.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary);
}

/* Example Buttons */
.calc-examples {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.examples-label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-thai);
    font-size: 0.85rem;
}

.example-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.example-btn.hv-btn {
    border-color: var(--warning);
    color: var(--warning);
}

.example-btn.hv-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

/* HV Warning */
.hv-warning {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: 0.9rem;
    animation: pulse-warning 2s infinite;
}

.hv-warning.hidden {
    display: none;
}

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

/* Input Presets */
.input-presets {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.input-presets button {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.input-presets button:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Custom Cell Inputs */
.custom-cell-inputs {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.custom-cell-inputs.hidden {
    display: none;
}

.custom-cell-inputs label {
    display: block;
    margin-bottom: 6px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.custom-cell-inputs label:first-child {
    margin-top: 0;
}

/* Voltage Option Groups */
#targetVoltage optgroup {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

#targetVoltage option {
    padding: 8px;
    background: var(--bg-tertiary);
}

/* Responsive Calculator */
@media (max-width: 768px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
    
    .example-buttons {
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .input-presets {
        flex-wrap: wrap;
    }
}


/* ===== FAQ Section ===== */
.faq-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--accent-primary);
}

.faq-question {
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-thai);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 600px;
}

.faq-answer-content {
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.faq-answer-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.faq-answer-content li {
    margin-bottom: 8px;
}

.faq-answer-content strong {
    color: var(--text-primary);
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
}

.faq-answer-content strong:first-child {
    margin-top: 0;
}


/* ===== Footer Creator ===== */
.footer-creator {
    margin: 20px 0;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.footer-creator p {
    margin-bottom: 4px;
}

.footer-creator strong {
    color: var(--accent-primary);
    font-weight: 600;
}

.footer-creator .project-name {
    font-size: 1.1rem;
    color: var(--warning);
    font-weight: 500;
    margin-top: 8px;
}


/* ===== Shop Button ===== */
.btn-shop {
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6633 100%);
    color: white;
    border: none;
}

.btn-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(238, 77, 45, 0.4);
}

.nav-shop {
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6633 100%) !important;
    color: white !important;
    border-radius: 8px;
}

.nav-shop:hover {
    box-shadow: 0 2px 10px rgba(238, 77, 45, 0.4);
}


/* ===== Hero Creator Section ===== */
.hero-creator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
}

.creator-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-primary);
}

.creator-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-info {
    text-align: left;
}

.creator-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.creator-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.creator-project {
    font-size: 1rem;
    color: var(--warning);
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero-creator {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .creator-info {
        text-align: center;
    }
    
    .creator-logo {
        width: 70px;
        height: 70px;
    }
    
    .creator-name {
        font-size: 1rem;
    }
}

/* ===== Creator Links ===== */
.creator-logo-link {
    display: block;
    cursor: pointer;
    transition: var(--transition);
}

.creator-logo-link:hover {
    transform: scale(1.05);
}

.fb-icon-link {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
    color: #1877F2;
    transition: var(--transition);
}

.fb-icon-link:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(24, 119, 242, 0.4));
}
