/* ===== ROOT VARIABLES ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent-blue: #2196F3;
    --accent-green: #4CAF50;
    --accent-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Section Colors */
    --day-bg: #e3f2fd;
    --swing-bg: #e8f5e9;
    --night-bg: #f3e5f5;
    
    /* Overlay */
    --overlay-blur: blur(8px);
}

[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --border-color: #4a5568;
    --shadow: rgba(0, 0, 0, 0.3);
    
    --day-bg: #2c5282;
    --swing-bg: #2f855a;
    --night-bg: #6b46c1;
}

/* ===== GLOBAL STYLES ===== */
* {
    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);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.admin-link:hover {
    background: var(--accent-blue);
    color: white;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--accent-blue);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    opacity: 0.8;
}

.sun-icon,
.moon-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    transition: all 0.3s ease;
}

.sun-icon {
    left: 5px;
}

.moon-icon {
    right: 5px;
    opacity: 0;
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
}

/* ===== MAIN SELECTION SCREEN ===== */
.main-selection {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.main-selection.active {
    opacity: 1;
    pointer-events: all;
}

.selection-container {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.selection-word {
    transition: all 0.3s ease;
}

.selection-word.visitor-only {
    cursor: default;
    pointer-events: none;
}

.selection-word h1 {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
}

.selection-word.fade-out {
    opacity: 0;
    transform: scale(0.8);
}

.selection-word.move-top {
    animation: moveToTop 0.6s ease forwards;
}

@keyframes moveToTop {
    to {
        transform: translateY(-40vh) scale(0.6);
    }
}

/* ===== CONTENT AREA ===== */
.content-area {
    min-height: 100vh;
    padding: 80px 2rem 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.content-area.active {
    opacity: 1;
    pointer-events: all;
}

.selected-title {
    text-align: center;
    margin-bottom: 1rem;
    display: none;
}

.selected-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.content-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.content-column {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
}

.column-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.day-section {
    background: var(--day-bg);
}

.swing-section {
    background: var(--swing-bg);
}

.night-section {
    background: var(--night-bg);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== ITEMS GRID ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
}

.item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow);
    background: var(--accent-blue);
    color: var(--accent-white);
}

.item-text {
    font-weight: 500;
    flex: 1;
}

.info-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: help;
    transition: all 0.3s ease;
}

.item:hover .info-icon {
    background: var(--accent-white);
    color: var(--accent-blue);
}

/* Info Tooltip */
.info-tooltip {
    position: absolute;
    bottom: 110%;
    right: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 250px;
    box-shadow: 0 4px 12px var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.info-icon:hover .info-tooltip {
    opacity: 1;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
}

/* ===== BACK BUTTON ===== */
.back-button {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2.5rem;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--shadow);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    background: var(--accent-green);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* ===== 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);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-blue);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.file-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.file-item:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateX(5px);
}

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

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--accent-green);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
}

.notification.show {
    transform: translateX(0);
}

/* ===== BACKGROUND OVERLAY ===== */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.3;
    transition: filter 0.5s ease, opacity 0.5s ease;
}

.background-overlay.blur {
    filter: var(--overlay-blur);
    opacity: 0.25;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 5px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .selection-word h1 {
        font-size: 3rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        padding: 1rem;
    }
    
    .back-button {
        bottom: 1rem;
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}
