/* General styles for the tournament page */
body { /* Added to ensure no default body margin interferes */
    margin: 0;
}

.neon-background {
    background: radial-gradient(circle, #050505, #000000); /* Subtle gradient for depth */
    color: #ecf0f1;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
    position: relative; /* For absolute positioning of neon lights */
    min-height: 100vh; /* Ensure background covers full viewport height */
}

/* Neon Lights */
.neon-background::before,
.neon-background::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(150px);
    animation: moveLight 8s infinite alternate ease-in-out;
    z-index: 0; /* Behind page content but above plain background */
}

.neon-background::before {
    background: rgba(0, 255, 255, 0.7); /* Cyan light */
    top: 30%;
    left: 20%;
}

.neon-background::after {
    background: rgba(255, 0, 255, 0.7); /* Magenta light */
    bottom: 30%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes moveLight {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, -50px);
    }
}

/* NAVIGATION BAR INTEGRATION STYLING */
#main-tournament-content {
    transition: margin-left 0.3s ease-in-out; /* Smooth transition for sidebar */
}

#tournament-page {
    max-width: 1200px;
    margin: 50px auto; /* Default margin, will be adjusted by nav integration */
    color: #ecf0f1;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.5);
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
    transform: translateY(20px);
    position: relative;
    z-index: 2; /* Above neon lights */
    background-color: rgba(10, 10, 20, 0.85); /* Added a subtle base background */
    backdrop-filter: blur(3px); /* Subtle blur for depth */
    overflow: hidden; /* Ensure child elements respect border-radius */
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles */
.tournament-header {
    padding: 40px 30px; /* Increased padding */
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px; /* Increased gap */
    border-bottom: 2px solid rgba(0, 255, 255, 0.3); /* Subtle separator */
}

.tournament-cover {
    width: calc(100% - 40px); /* Inset from padding */
    max-width: 800px; /* Max width for cover image */
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 6px 15px rgba(0, 255, 255, 0.6); /* Enhanced shadow */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid rgba(0,255,255,0.2); /* Subtle border */
}

.tournament-cover:hover {
    transform: scale(1.05); /* Slightly less aggressive scale */
    box-shadow: 0 10px 25px rgba(255, 0, 255, 0.7); /* Enhanced hover shadow */
}

.tournament-header h1 {
    font-size: 3.2em; /* Slightly adjusted */
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.9), 0 0 25px rgba(255, 0, 255, 0.7); /* Enhanced text shadow */
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-info {
    font-size: 1.2em;
    color: #bdc3c7;
    font-style: italic;
}

/* Button Styles (General Toggle Button) */
.toggle-video-button { /* Renamed ID to class for general use if needed, kept ID for specificity */
    padding: 12px 25px; /* Increased padding */
    border: none;
    background: linear-gradient(45deg, #1abc9c, #16a085); /* Gradient background */
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 5px 12px rgba(0, 255, 255, 0.5); /* Enhanced shadow */
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.toggle-video-button::before { /* Swipe effect on hover */
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.4s ease;
    transform: skewX(-30deg);
}

.toggle-video-button:hover {
    background: linear-gradient(45deg, #16a085, #1abc9c); /* Reverse gradient */
    transform: translateY(-3px) scale(1.05); /* Combined transform */
    box-shadow: 0 8px 20px rgba(255, 255, 0, 0.6); /* More prominent hover shadow */
}
.toggle-video-button:hover::before {
    left: 100%;
}
.toggle-video-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 3px 8px rgba(0, 255, 255, 0.4);
}


/* Video Container (for the single video in header) */
.video-controls { /* Wrapper for the button if needed */
    margin-bottom: 15px;
}
.video-container {
    position: relative;
    width: 100%; /* Take full width of its column in header */
    max-width: 800px; /* Max width for a standard video */
    margin: 0 auto 20px auto; /* Centered with bottom margin */
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px; /* Added border-radius */
    box-shadow: 0 6px 15px rgba(0, 255, 255, 0.4); /* Consistent shadow */
    border: 1px solid rgba(0,255,255,0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    /* box-shadow removed as it's on parent .video-container now */
}

/* Content Styles */
.tournament-content {
    padding: 30px; /* Increased padding */
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 30px; /* Increased gap */
}

.tournament-details,
.tournament-results {
    padding: 25px; /* Increased padding */
    background: rgba(30, 45, 60, 0.9); /* Darker, more refined background */
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 255, 255, 0.4); /* Enhanced shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(0, 255, 255, 0.2); /* Subtle border */
}

.tournament-details:hover,
.tournament-results:hover {
    transform: translateY(-7px); /* Slightly less lift */
    box-shadow: 0 10px 20px rgba(255, 0, 255, 0.6); /* Enhanced hover shadow */
    border-color: rgba(255,0,255,0.4);
}

.tournament-details h2, .tournament-results h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1abc9c;
    text-shadow: 0 0 8px rgba(26, 188, 156, 0.6);
    border-bottom: 2px solid rgba(26, 188, 156, 0.3);
    padding-bottom: 10px;
}


/* List Styles */
.tournament-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tournament-details li {
    margin-bottom: 12px;
    padding: 12px 15px; /* Increased padding */
    border-radius: 6px; /* Slightly more rounded */
    background: rgba(40, 60, 75, 0.9); /* Darker list items */
    color: #e0e0e0;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 3px solid transparent; /* Prepare for highlight */
}

.tournament-details li:hover {
    background-color: rgba(50, 75, 90, 0.9); /* Hover background */
    transform: translateX(5px) scale(1.02); /* Slide and subtle scale */
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
    border-left-color: rgba(0,255,255,0.7);
}

/* Table Styles */
.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.results-table {
    width: 100%;
    min-width: 500px; /* Prevent extreme squishing before scroll */
    border-collapse: collapse;
    /* box-shadow and overflow handled by wrapper */
}

.results-table th,
.results-table td {
    border: 1px solid rgba(127, 140, 141, 0.4); /* Slightly more visible border */
    padding: 12px; /* Increased padding */
    text-align: left;
    color: #e0e0e0;
}

.results-table th {
    background-color: rgba(35, 55, 70, 0.9); /* Darker header */
    color: #1abc9c;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0,255,255,0.4);
}

.results-table tbody tr:hover {
    background-color: rgba(45, 70, 90, 0.9); /* Darker hover */
    transform: scale(1.01); /* Subtle scale */
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.5); /* Magenta glow */
    cursor: pointer;
}

/* Photo Styles */
.photo-modal {
    display: flex; /* Already flex, good for centering */
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Slightly darker overlay */
    z-index: 1001; /* Ensure above nav's smallNav (z-index 1000) */
    padding: 20px; /* Add padding for small screens */
    box-sizing: border-box;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2); /* Softer shadow */
    display: block; /* Ensure it behaves like an image */
    object-fit: contain; /* Ensure image scales correctly */
}

.close-button {
    position: absolute;
    top: 20px; /* Adjusted position */
    right: 25px; /* Adjusted position */
    font-size: 36px; /* Larger close icon */
    color: white;
    cursor: pointer;
    font-weight: bold;
    text-shadow: 0 0 5px black; /* Add shadow for better visibility */
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-button:hover {
    color: #e74c3c; /* Red hover */
    transform: scale(1.1);
}

.photo-button {
    display: block;
    margin: 25px auto; /* Increased margin */
    padding: 12px 25px; /* Consistent with toggle-video-button */
    font-size: 1em; /* Consistent sizing */
    font-weight: bold;
    background: linear-gradient(45deg, #e74c3c, #c0392b); /* Red gradient */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease; /* Smoother transition */
    box-shadow: 0 5px 12px rgba(231, 76, 60, 0.5); /* Red glow */
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.photo-button::before { /* Swipe effect */
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.4s ease;
    transform: skewX(-30deg);
}

.photo-button:hover {
    background: linear-gradient(45deg, #c0392b, #e74c3c); /* Reverse gradient */
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.7);
}
.photo-button:hover::before {
    left: 100%;
}
.photo-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.4);
}


/* Video Styling (general section, not the header one) - CURRENTLY NOT USED IN HTML */
/* If you add more .video-section elements later, these styles will apply. */
/*
.video-section {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 255, 255, 0.6);
    margin-bottom: 20px;
    text-align: center;
}
.video-section .video-controls {
    margin-bottom: 10px;
}
.video-section .toggle-video-button { }
.video-section .video-container { }
.video-section .video-container iframe { }
*/

/* Media Queries */

/* Adjustments for Navigation Bar States */
@media screen and (min-width: 1200px) {
    #main-tournament-content {
        margin-left: 200px; /* Width of the sidebar */
    }
}

@media screen and (max-width: 1199px) {
    #main-tournament-content {
        margin-left: 0;
    }
    #tournament-page {
        /* Body gets padding-top: 50px from nav bar CSS. */
        /* Default margin: 50px auto. New top: 30px */
        /* Total top space = 50px (body padding) + 30px = 80px */
        margin-top: 30px;
    }
}

/* Responsive adjustments for content */
@media (min-width: 768px) and (max-width: 1199px) { /* Tablet range, also applies when sidebar not present */
    .tournament-content {
        grid-template-columns: 1fr 1fr; /* Two columns for details and results */
    }
}

@media (max-width: 768px) {
    #tournament-page {
        margin: 20px auto; /* Adjusted for smaller screens; total top space 50px + 20px = 70px */
        border-radius: 10px;
    }

    .tournament-header {
        padding: 25px 15px; /* Reduced padding */
        gap: 20px;
    }

    .tournament-cover {
        max-height: 300px; /* Reduced max height */
        width: calc(100% - 20px);
    }

    .tournament-header h1 {
        font-size: 2.4em; /* Smaller heading */
    }

    .header-info {
        font-size: 1em;
    }

    .toggle-video-button,
    .photo-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .video-container {
        /* min-width and min-height are already set to 0 in the original CSS for this breakpoint */
        /* The malformed iframe rules were removed/corrected. */
        /* Base .video-container style is responsive with padding-bottom trick. */
    }

    .tournament-content {
        padding: 20px;
        gap: 20px;
        grid-template-columns: 1fr; /* Ensure single column */
    }

    .tournament-details,
    .tournament-results {
        padding: 20px;
    }
    .tournament-details h2, .tournament-results h2 {
        font-size: 1.6em;
    }


    .tournament-details li {
        padding: 10px;
        font-size: 0.9em;
    }

    .table-responsive-wrapper {
        margin-top: 15px;
    }
    .results-table {
        min-width: 0; /* Allow table to shrink more, rely on scroll */
    }
    .results-table th,
    .results-table td {
        padding: 8px;
        font-size: 0.9em;
    }

    .neon-background::before,
    .neon-background::after {
        width: 200px;
        height: 200px;
        filter: blur(100px);
    }
}

@media (max-width: 480px) {
    #tournament-page {
        margin-top: 15px; /* Further reduce top margin on very small screens */
        /* Total top space 50px + 15px = 65px */
        border-radius: 5px;
    }
    .tournament-header {
        padding: 20px 10px;
    }

    .tournament-cover {
        max-height: 220px;
    }

    .tournament-header h1 {
        font-size: 1.8em;
    }
    .header-info {
        font-size: 0.9em;
    }


    .toggle-video-button,
    .photo-button {
        padding: 8px 15px;
        font-size: 0.8em;
        width: calc(100% - 20px); /* Make buttons take more width */
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
    }
    .photo-button { /* specific for photo button which might have different context */
        max-width: 280px; /* Limit max width for photo button */
    }


    .tournament-content {
        padding: 15px;
    }

    .tournament-details,
    .tournament-results {
        padding: 15px;
    }
    .tournament-details h2, .tournament-results h2 {
        font-size: 1.4em;
    }

    .tournament-details li {
        padding: 8px;
        font-size: 0.85em;
    }

    .results-table th,
    .results-table td {
        padding: 6px;
        font-size: 0.8em;
    }

    .neon-background::before,
    .neon-background::after {
        width: 150px;
        height: 150px;
        filter: blur(75px);
    }

    .modal-content {
        max-width: 95%; /* Allow image to be slightly larger on small screens */
        max-height: 85vh;
    }
    .close-button {
        top: 10px;
        right: 10px;
        font-size: 28px;
    }
}