* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background: linear-gradient(135deg, #2a2f4a 0%, #3a3f5a 50%, #2f3449 100%);
    background-attachment: fixed;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 147, 26, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

header {
    background: linear-gradient(135deg, #f7931a 0%, #ffa64d 100%);
    color: #fff;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.3);
    z-index: 1;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.auto-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: rgba(247, 147, 26, 0.9);
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.auto-badge.visible {
    opacity: 1;
    transform: scale(1);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

header .logo {
    width: 50vw;
    max-width: 200px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

header .logo:hover {
    transform: scale(1.05);
}

.icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.icons a {
    color: #fff;
    font-size: 2.2rem;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.icons a:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.icons a img {
    transition: transform 0.3s ease;
    width: 2rem;
    margin-top: 10px;
}

.icons a:hover img {
    transform: scale(1.1);
}

a.white {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

a.white:hover {
    border-bottom-color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

header p {
    font-size: 25px;
    margin: 0.5rem 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.4);
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

header p.small {
    font-size: 18px;
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.4);
    font-weight: 500;
    color: #ffffff;
}

h1 {
    font-size: min(14vw, 5rem);
    margin: 2rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 0, 0, 0.4);
}

.logo-font {
    color: rgba(255, 255, 255, 0.98);
    font-family: 'Caveat', cursive;
    font-weight: 700;
}

.main-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr min-content;
    margin: 0 auto;
    padding: 40px 20px;
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

.sidebar {
    order: 2;
    width: 380px;
}

@media (max-width: 1030px) {
    .sidebar {
        order: 0;
        width: 100%;
    }

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

.panel {
    padding: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f7931a, #ffa64d, #f7931a);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(247, 147, 26, 0.2);
    border-color: rgba(247, 147, 26, 0.3);
}

.panel:hover::before {
    opacity: 1;
}

.panel h2 {
    color: #f7931a;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.panel h3 {
    color: #f7931a;
    font-size: 22px;
    margin-bottom: 15px;
}

p {
    font-size: 18px;
    line-height: 1.8;
    color: #d0d0d0;
}

.panel a {
    color: #f7931a;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.panel a:hover {
    color: #ffa64d;
    border-bottom-color: #ffa64d;
    text-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

.event-details {
    margin-top: 20px;
    max-width: 340px;
    margin: 0 auto;
}

@media (min-width: 720px) {
    .event-details {
        max-width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .event-details .thumbnail {
        order: 1;
        align-self: center;
        justify-self: right;
    }
}

@media (min-width: 1031px) {
    .event-details {
        display: block;
    }
}

.event-details h2 {
    font-size: 24px;
    color: #f7931a;
    margin-bottom: 15px;
    line-height: 1.4;
}

.event-details h2 a {
    color: #f7931a;
    text-decoration: none;
    transition: all 0.3s ease;
}

.event-details h2 a:hover {
    color: #ffa64d;
    text-shadow: 0 0 10px rgba(247, 147, 26, 0.6);
}

.event-details p {
    font-size: 16px;
    margin: 8px 0;
}

.event-details img.thumbnail {
    max-width: 340px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.event-details img.thumbnail:hover {
    transform: scale(1.02);
}

/* Event toggle: no-event shows placeholder, has-event shows actual event */
.event-details.no-event .event-thumbnail,
.event-details.no-event .event-info {
    display: none;
}

.event-details.no-event .placeholder-thumbnail,
.event-details.no-event .event-placeholder {
    display: block;
}

.event-details.has-event .placeholder-thumbnail,
.event-details.has-event .event-placeholder {
    display: none;
}

.event-details.has-event .event-thumbnail,
.event-details.has-event .event-info {
    display: block;
}

.panel ul {
    list-style: none;
    padding-left: 0;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.panel ul::-webkit-scrollbar {
    width: 8px;
}

.panel ul::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel ul::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f7931a, #ffa64d);
    border-radius: 4px;
}

.panel ul::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffa64d, #f7931a);
}

.panel ul li {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    padding-left: 0;
    position: relative;
}

.panel ul li:last-child {
    border-bottom: none;
}

.panel ul li:hover {
    color: #fff;
}

.panel ul li a {
    color: #f7931a;
    margin-left: 5px;
}

.panel ul li a i {
    font-size: smaller;
    vertical-align: super;
}

.panel strong {
    color: #f7931a;
    font-weight: 600;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f7931a, #ffa64d);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffa64d, #f7931a);
}

/* Light mode styles - applies to both manual light-mode and auto-mode (when system prefers light) */
@media (prefers-color-scheme: light) {
    body.auto-mode,
    body.light-mode {
        background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f2f5 100%);
        color: #2c3e50;
    }

    body.auto-mode::before,
    body.light-mode::before {
        background-image: 
            radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(247, 147, 26, 0.08) 0%, transparent 50%);
    }

    body.auto-mode .panel,
    body.light-mode .panel {
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }

    body.auto-mode .panel:hover,
    body.light-mode .panel:hover {
        box-shadow: 0 12px 40px rgba(247, 147, 26, 0.15);
        border-color: rgba(247, 147, 26, 0.3);
    }

    body.auto-mode p,
    body.light-mode p {
        color: #34495e;
    }

    body.auto-mode .panel ul li,
    body.light-mode .panel ul li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    body.auto-mode .panel ul li:hover,
    body.light-mode .panel ul li:hover {
        color: #1a1a1a;
    }

    body.auto-mode .event-details img.thumbnail,
    body.light-mode .event-details img.thumbnail {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    body.auto-mode ::-webkit-scrollbar-track,
    body.light-mode ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }

    body.auto-mode .panel ul::-webkit-scrollbar-track,
    body.light-mode .panel ul::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }

    body.auto-mode .ai-footer p,
    body.light-mode .ai-footer p {
        color: rgba(0, 0, 0, 0.4);
    }

    body.auto-mode .panel h2,
    body.auto-mode .panel h3,
    body.light-mode .panel h2,
    body.light-mode .panel h3 {
        text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.35);
    }

    body.auto-mode .event-details h2,
    body.light-mode .event-details h2 {
        text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.35);
    }

    body.auto-mode header p,
    body.auto-mode header h1,
    body.auto-mode header .logo-font {
        color: #ffffff !important;
    }
}

/* Manual light mode (always applies, not just in media query) */
body.light-mode {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f2f5 100%);
    color: #2c3e50;
}

body.light-mode::before {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 147, 26, 0.08) 0%, transparent 50%);
}

body.light-mode .panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-mode .panel:hover {
    box-shadow: 0 12px 40px rgba(247, 147, 26, 0.15);
    border-color: rgba(247, 147, 26, 0.3);
}

body.light-mode p {
    color: #34495e;
}

body.light-mode .panel ul li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .panel ul li:hover {
    color: #1a1a1a;
}

body.light-mode .event-details img.thumbnail {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .panel ul::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .ai-footer p {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .panel h2,
body.light-mode .panel h3 {
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.35);
}

body.light-mode .event-details h2 {
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.35);
}

/* Dark mode styles - applies to both manual dark-mode and auto-mode (when system prefers dark) */
@media (prefers-color-scheme: dark) {
    body.auto-mode {
        background: linear-gradient(135deg, #2a2f4a 0%, #3a3f5a 50%, #2f3449 100%);
        color: #e0e0e0;
    }

    body.auto-mode::before {
        background-image: 
            radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(247, 147, 26, 0.05) 0%, transparent 50%);
    }

    body.auto-mode .panel {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    body.auto-mode .panel:hover {
        box-shadow: 0 12px 40px rgba(247, 147, 26, 0.2);
        border-color: rgba(247, 147, 26, 0.3);
    }

    body.auto-mode p {
        color: #d0d0d0;
    }

    body.auto-mode .panel ul li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    body.auto-mode .panel ul li:hover {
        color: #fff;
    }

    body.auto-mode .event-details img.thumbnail {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    body.auto-mode ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.2);
    }

    body.auto-mode .panel ul::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }

    body.auto-mode .ai-footer p {
        color: rgba(255, 255, 255, 0.4);
    }

    body.auto-mode header p,
    body.auto-mode header h1,
    body.auto-mode header .logo-font {
        color: #ffffff !important;
    }
}

/* Manual dark mode - always applies when dark-mode class is present */
body.dark-mode {
    background: linear-gradient(135deg, #2a2f4a 0%, #3a3f5a 50%, #2f3449 100%);
    color: #e0e0e0;
}

body.dark-mode::before {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(247, 147, 26, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 147, 26, 0.05) 0%, transparent 50%);
}

body.dark-mode .panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body.dark-mode .panel:hover {
    box-shadow: 0 12px 40px rgba(247, 147, 26, 0.2);
    border-color: rgba(247, 147, 26, 0.3);
}

body.dark-mode p {
    color: #d0d0d0;
}

body.dark-mode .panel ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .panel ul li:hover {
    color: #fff;
}

body.dark-mode .event-details img.thumbnail {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .panel ul::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

/* Header text should always be white, regardless of theme */
body.light-mode header p,
body.light-mode header h1,
body.light-mode header .logo-font,
body.dark-mode header p,
body.dark-mode header h1,
body.dark-mode header .logo-font {
    color: #ffffff !important;
}

/* AI Footer */
.ai-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.ai-footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    font-style: italic;
}

@media (prefers-color-scheme: light) {
    body.auto-mode .ai-footer p {
        color: rgba(0, 0, 0, 0.4);
    }
}

body.light-mode .ai-footer p {
    color: rgba(0, 0, 0, 0.4);
}

body.dark-mode .ai-footer p {
    color: rgba(255, 255, 255, 0.4);
}

