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

:root {
    /* Dark Theme Colors */
    --primary-orange: #ed4703;
    --dark-blue: #161c31;
    --darker-blue: #0d1220;
    --text-light: #ffffff;
    --text-dim: #b0b0b0;
    --border-color: rgba(237, 71, 3, 0.3);
    
    /* Light Theme Colors */
    --light-primary-orange: #ff6b35;
    --light-bg: #e8f0f7;
    --light-container: #ffffff;
    --light-darker: #d4e4f0;
    --light-text: #1a1a1a;
    --light-text-dim: #666666;
    --light-border: rgba(255, 107, 53, 0.3);
}

/* Light Theme */
body[data-theme="light"] {
    --primary-orange: var(--light-primary-orange);
    --dark-blue: var(--light-bg);
    --darker-blue: var(--light-darker);
    --text-light: var(--light-text);
    --text-dim: var(--light-text-dim);
    --border-color: var(--light-border);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--dark-blue);
    color: var(--text-light);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary-orange);
    box-shadow: 0 6px 20px rgba(237, 71, 3, 0.4);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--primary-orange);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

body[data-theme="light"] .sun-icon {
    display: block;
}

body[data-theme="light"] .moon-icon {
    display: none;
}

/* Main Section - Full viewport */
.main-section {
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--dark-blue);
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100%;
    gap: 0;
}

/* Image Container - Left side with rounded right edge */
.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0 40px 40px 0;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Blurred background layer for image scaling */
.image-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.1);
    z-index: 0;
}

.slider {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    transform: translateX(100%);
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.slide.prev {
    opacity: 0;
    transform: translateX(-100%);
    z-index: 1;
}

/* Content Container - Right side */
.content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding: 60px 50px;
    background: var(--darker-blue);
    overflow-y: auto;
    position: relative;
    z-index: 3;
}

/* Add overlay to prevent background bleeding through */
.content-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: 0;
    bottom: -50px;
    background: var(--darker-blue);
    z-index: -1;
    border-radius: 0 40px 40px 0;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    max-width: 100%;
    height: auto;
    max-height: 140px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Links Grid - Responsive column layout */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.column-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-orange);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Link Boxes */
.link-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    background: var(--dark-blue);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    line-height: 1.4;
}

.link-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(237, 71, 3, 0.4), transparent);
    transition: left 0.5s ease;
}

.link-box:hover::before {
    left: 100%;
}

.link-box:hover {
    background: rgba(237, 71, 3, 0.15);
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 71, 3, 0.4);
}

/* Bottom Links */
.bottom-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid rgba(237, 71, 3, 0.2);
    flex-wrap: wrap;
    gap: 20px;
}

.patronite-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--dark-blue);
    border: 2px solid var(--primary-orange);
    border-radius: 10px;
    color: var(--primary-orange);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.flame-icon {
    width: 22px;
    height: 22px;
    fill: var(--primary-orange);
}

.patronite-link:hover {
    background: var(--primary-orange);
    color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 71, 3, 0.5);
}

.patronite-link:hover .flame-icon {
    fill: var(--dark-blue);
}

.scroll-down-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--dark-blue);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.scroll-down-link:hover {
    background: rgba(237, 71, 3, 0.15);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 71, 3, 0.4);
}

.language-selector {
    display: flex;
    gap: 12px;
}

.lang-flag {
    display: block;
    width: 55px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.lang-flag.active,
.lang-flag:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 71, 3, 0.4);
    opacity: 1;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Second Section */
.second-section {
    min-height: 100vh;
    position: relative;
    padding: 80px 40px;
    background: var(--darker-blue);
}

/* Fixed background wrapper */
.background-overlay-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.jpg') center/cover no-repeat;
    background-attachment: fixed;
    opacity: 0.08;
    filter: blur(3px);
}

.second-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.second-content h2 {
    font-size: 48px;
    margin-bottom: 40px;
    color: var(--primary-orange);
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Media Switcher */
.media-switcher {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.switch-btn {
    padding: 12px 30px;
    background: var(--dark-blue);
    border: 2px solid rgba(237, 71, 3, 0.3);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-btn:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
}

.switch-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    box-shadow: 0 4px 15px rgba(237, 71, 3, 0.4);
}

/* Media Content */
.media-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.media-content.active {
    display: block;
}

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

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 60px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.gallery-item {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(237, 71, 3, 0.4);
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: var(--primary-orange);
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    color: #ff8c5a;
    transform: scale(1.2);
}

/* Results Section */
.results-section {
    background: var(--dark-blue);
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.results-section h3 {
    font-size: 36px;
    margin-bottom: 30px;
    color: var(--primary-orange);
    text-align: center;
}

/* Contest Selector */
.contest-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
}

.contest-btn {
    padding: 14px 28px;
    background: var(--darker-blue);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contest-btn:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
}

.contest-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 71, 3, 0.4);
}

/* Sheet Selector */
.sheet-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.sheet-btn {
    padding: 12px 24px;
    background: var(--darker-blue);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sheet-btn:hover {
    border-color: var(--primary-orange);
    transform: translateY(-2px);
}

.sheet-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--dark-blue);
    box-shadow: 0 4px 15px rgba(237, 71, 3, 0.4);
}

body[data-theme="light"] .sheet-btn.active,
body[data-theme="light"] .contest-btn.active {
    color: white;
}

.loading-text {
    text-align: center;
    color: var(--text-dim);
    font-size: 18px;
    padding: 40px;
}

/* Results Table */
.results-table-container {
    margin-top: 40px;
    overflow-x: auto;
}

.results-table-container table {
    width: 100%;
    border-collapse: collapse;
    background: var(--darker-blue);
    border-radius: 10px;
    overflow: hidden;
}

.results-table-container th {
    background: var(--primary-orange);
    color: var(--dark-blue);
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

body[data-theme="light"] .results-table-container th {
    color: white;
}

.results-table-container td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.results-table-container tr:hover {
    background: rgba(237, 71, 3, 0.1);
}

.results-table-container tr:last-child td {
    border-bottom: none;
}

/* Podium Highlights */
.results-table-container tr:nth-child(1) td:first-child {
    background: linear-gradient(90deg, #FFD700 0%, transparent 100%);
    font-weight: 700;
}

.results-table-container tr:nth-child(2) td:first-child {
    background: linear-gradient(90deg, #C0C0C0 0%, transparent 100%);
    font-weight: 700;
}

.results-table-container tr:nth-child(3) td:first-child {
    background: linear-gradient(90deg, #CD7F32 0%, transparent 100%);
    font-weight: 700;
}

/* Tablet Responsive */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .image-container {
        height: 50vh;
        min-height: 400px;
        border-radius: 0 0 40px 40px;
    }

    .content-container {
        border-radius: 0;
    }

    .main-section {
        height: auto;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .content-container {
        padding: 40px 30px;
        gap: 30px;
    }

    .links-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .link-box {
        font-size: 14px;
        padding: 12px 16px;
    }

    .column-title {
        font-size: 18px;
    }

    .bottom-links {
        flex-direction: column;
        align-items: stretch;
    }

    .patronite-link,
    .scroll-down-link {
        justify-content: center;
    }

    .language-selector {
        justify-content: center;
    }

    .second-content h2 {
        font-size: 32px;
    }

    .results-section {
        padding: 30px 20px;
    }

    .results-section h3 {
        font-size: 28px;
    }

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

    .results-table-container {
        font-size: 12px;
    }

    .results-table-container th,
    .results-table-container td {
        padding: 10px 8px;
    }
    
    /* Disable fixed background on mobile for better performance */
    .background-overlay-wrapper {
        position: absolute;
    }
    
    .background-overlay {
        background-attachment: scroll;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .image-container {
        height: 40vh;
        min-height: 300px;
    }

    .content-container {
        padding: 30px 20px;
    }

    .logo {
        max-height: 100px;
    }
}