/* ===== CSS Variables ===== */
:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --special-color: #dc2626;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #1f1f1f;
    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --special-color: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, 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;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.sun-icon,
.moon-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 40px 0 60px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--special-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Loading Spinner ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 20px;
    color: var(--text-secondary);
}

/* ===== Error Message ===== */
.error-message {
    text-align: center;
    padding: 40px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    margin: 20px 0;
}

.error-message p {
    color: var(--special-color);
    font-size: 1.1rem;
}

/* ===== Sections ===== */
.video-section,
.info-section,
.gallery-section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
}

.special-title {
    border-bottom-color: var(--special-color);
}

.special-badge {
    background-color: var(--special-color);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-right: 8px;
    font-weight: 600;
}

/* ===== Video Container ===== */
.video-container {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-container video,
.video-container iframe,
.video-container embed,
.video-container object {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.video-container script + div,
.video-container script + iframe,
.video-container > div {
    max-width: 100% !important;
    overflow: hidden;
}

/* ===== Info Card ===== */
.info-card {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
}

.subsection-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

/* ===== Thumbnail ===== */
.thumbnail-container {
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.title-image {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.title-image:hover {
    transform: scale(1.02);
}

/* ===== Info Table ===== */
.info-table {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.info-row {
    display: flex;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.info-label {
    min-width: 100px;
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    flex: 1;
    color: var(--text-primary);
}

/* ===== Description ===== */
.description {
    line-height: 1.8;
    color: var(--text-primary);
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

/* ===== Video Link Button ===== */
.video-link {
    margin-top: 32px;
    text-align: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* ===== Gallery ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery a {
    display: block;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.gallery a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.gallery img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px 0 40px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

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

    .card-title {
        font-size: 1.6rem;
    }

    .subsection-title {
        font-size: 1.2rem;
    }

    .info-card {
        padding: 20px;
    }

    .info-row {
        flex-direction: column;
        padding: 12px 16px;
    }

    .info-label {
        margin-bottom: 4px;
        font-weight: 700;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .gallery img {
        height: 150px;
    }

    .btn-primary {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.5s ease-out;
}

/* ===== Special Section Highlight ===== */
.special {
    position: relative;
}

.special::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--special-color), transparent);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .special::before {
        left: -15px;
    }
}
