:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-primary: #0d6efd;
    --accent-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --header-bg: #1a1d29;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

[data-theme="dark"] {
    --bg-primary: #1a1d29;
    --bg-secondary: #23263a;
    --bg-card: #2a2d42;
    --text-primary: #e8e9ed;
    --text-secondary: #a8aab5;
    --accent-primary: #4d9fff;
    --accent-secondary: #8a8c9a;
    --border-color: #3a3d52;
    --shadow: rgba(0, 0, 0, 0.3);
    --header-bg: #13151f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.hamburger-menu {
    display: none;
    background: none;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-primary);
}

.nav-dark-mode {
    color: #fff;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s;
}

.nav-dark-mode:hover {
    transform: scale(1.2);
    background: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.points-display {
    background: var(--bg-card);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 5px var(--shadow);
    position: relative;
    cursor: pointer;
}

/* Floating popup for points */
.points-popup {
    display: none;
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
    z-index: 1500;
    min-width: 300px;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.points-popup.show {
    display: block;
}

.points-popup h3 {
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.points-popup .popup-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.points-popup .popup-detail:last-child {
    border-bottom: none;
}

.points-popup .popup-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.points-popup .popup-value {
    color: var(--accent-primary);
    font-weight: bold;
}

.points-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
}

.points-popup-close:hover {
    color: var(--text-primary);
}

#pointsValue {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--accent-primary);
    cursor: pointer;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

.btn-primary, .btn-secondary, .btn-action {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--accent-secondary);
    color: #fff;
}

.btn-action {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-action:hover {
    background: var(--accent-primary);
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--accent-primary), #6610f2);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
    display: none;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: none;
}

.hero p {
    display: none;
}

.point-info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.point-info-card h3::before {
    content: "";
}

#heroPoints {
    color: var(--accent-primary);
    font-size: 2rem;
}

.point-info-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem auto;
    max-width: 500px;
    box-shadow: 0 10px 30px var(--shadow);
    display: none;
}

.point-info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

#heroPoints {
    color: var(--accent-primary);
}

.countdown {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.point-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.point-info-card .point-actions {
    display: none;
}

/* Sections */
.section {
    padding: 4rem 0;
}

/* Collapsible Sections */
.collapsible-section {
    transition: all 0.3s ease;
}

.collapsible-section.collapsed {
    padding: 2rem 0;
}

.collapse-content {
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.collapse-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.collapsed .collapse-toggle {
    transform: rotate(-90deg);
}

.collapsible-section h2 {
    position: relative;
    user-select: none;
}

.collapsible-section h2:hover {
    color: var(--accent-secondary);
}

.collapsible-section.collapsed {
    border-bottom: 2px solid var(--border-color);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

#graph h2 {
    font-size: 1.3rem;
}

/* Split Container for Graph and Video */
.split-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    height: 45vh;
}

.split-left,
.split-right {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.split-left h3,
.split-right h3 {
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-size: 1.3rem;
}

/* Chart */
.chart-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    height: calc(100% - 2.5rem);
}

/* Video Container */
.video-container {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    height: calc(100% - 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container iframe {
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

/* Burst Categories */
.burst-category {
    margin-bottom: 3rem;
}

.burst-category h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.5rem;
}

.burst-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.burst-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.burst-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow);
}

.burst-image {
    width: 100%;
    height: 150px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.burst-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-img {
    font-size: 4rem;
}

.burst-item h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--danger);
}

.burst-item p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.video-container-full {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-download {
    text-align: center;
    margin-top: 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--success);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
}

.download-btn:hover {
    background: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.download-icon {
    font-size: 1.2rem;
}

/* Video Transcript */
.transcript-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-top: 2rem;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.transcript-container h3 {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin: 0;
}

.tts-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
}

.tts-button:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.tts-button.playing {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.tts-icon {
    font-size: 1.2rem;
}

.tts-button.playing .tts-icon {
    animation: speaker 0.5s infinite;
}

@keyframes speaker {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.transcript-content {
    line-height: 1.8;
}

.transcript-content p {
    margin-bottom: 1.5rem;
}

.transcript-content ul,
.transcript-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.transcript-content li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.transcript-content strong {
    color: var(--accent-primary);
}

.transcript-credit {
    font-style: italic;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 2rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 3px solid var(--bg-primary);
}

.timeline-date {
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px var(--shadow);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card h3 {
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.read-more {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Education Section */
.section-education {
    background: var(--bg-secondary);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.education-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    border-left: 4px solid var(--accent-primary);
}

.education-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.education-card ul, .education-card ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.education-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.education-card .warning {
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1rem;
}

.education-card .highlight {
    background: #d1ecf1;
    color: #0c5460;
    padding: 0.75rem;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1rem;
}

[data-theme="dark"] .education-card .warning {
    background: #664d03;
    color: #fff3cd;
}

[data-theme="dark"] .education-card .highlight {
    background: #055160;
    color: #cff4fc;
}

/* About */
.about-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
}

.about-content h3, .about-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 50px var(--shadow);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-row .value {
    font-weight: bold;
    color: var(--accent-primary);
}

/* QR Code */
.qr-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.qr-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.qr-actions input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Footer */
footer {
    background: var(--header-bg);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .hamburger-menu {
        display: block;
    }

    .logo {
        display: none;
    }

    nav {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 250px;
        height: calc(100vh - 60px);
        background: var(--header-bg);
        transition: left 0.3s ease;
        z-index: 999;
        padding: 2rem 0;
        box-shadow: 2px 0 10px var(--shadow);
    }

    nav.active {
        left: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav ul li {
        width: 100%;
    }

    nav a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 1rem;
    }

    nav .nav-dark-mode {
        display: block;
        width: 100%;
        text-align: left;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.5rem;
    }

    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }

    .points-display {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .btn-primary {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .point-info-card {
        padding: 1.5rem;
    }

    .timeline {
        padding-left: 1rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    /* Stack split container on mobile */
    .split-container {
        flex-direction: column;
        height: auto;
    }

    .split-left,
    .split-right {
        flex: 1 1 100%;
        width: 100%;
        height: 45vh;
    }

    .chart-container {
        height: calc(100% - 2.5rem);
    }

    .video-container {
        height: calc(100% - 2.5rem);
    }

    .points-popup {
        right: 10px;
        left: 10px;
        min-width: auto;
        width: calc(100% - 20px);
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Points hidden state */
.points-hidden #pointsValue::after {
    content: '****';
}

.points-hidden #pointsValue {
    font-size: 0;
}
