/* Global Styles */
body, h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", sans-serif;
    color: #fff;
    margin: 0;
    padding: 0;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Outer container for the entire page content, sibling to nav bar */
.container { /* This is #main-content in the HTML */
    display: flex; /* This will help if we need to manage space around #main (its child) */
    justify-content: flex-start; /* Align #main to the start, margin on #main will handle sidebar */
    min-height: 100vh; /* Should be on body or a true full-page wrapper if body isn't one */
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    flex-grow: 1;
}

/* Main Content Styles - This is the div that gets the margin-left for the sidebar */
/* In eSports.html, this is: <div class="container" ... id="main-content"> */
#main-content {
    transition: margin-left 0.3s ease;
    width: 100%;
    flex-grow: 1;
    display: flex; /* Use flex to easily center its child (#main) */
    justify-content: center; /* Center #main horizontally */
    padding: 0; /* Remove padding here, apply to inner elements */
    box-sizing: border-box;
}

@media screen and (min-width: 1200px) {
    #main-content {
        margin-left: 200px;
    }
}

@media screen and (max-width: 1199px) {
    #main-content {
        margin-left: 0;
    }
}

/* Inner main content area - Child of #main-content */
/* In eSports.html, this is: <div class="w3-padding-large" id="main"> */
#main {
    width: 100%;
    max-width: 1200px; /* Let this be the container that limits width for content */
    /* The .content div inside this will be 100% of this #main */
    /* padding: 20px; -> w3-padding-large already adds padding.
                          If more specific padding is needed, add it here or to .content.
                          w3-padding-large is 16px top/bottom, 24px left/right. */
    box-sizing: border-box;
    /* display: flex; flex-direction: column; align-items: center; -> Not needed if .content handles its own layout */
}


/* Content Styles (the div with class="content" inside #main) */
.content {
    width: 100%;
    max-width: 1000px; /* Max width for the actual textual/element content within #main */
    margin: 0 auto;    /* This is KEY for centering .content within #main */
    padding: 20px;     /* Padding for the content itself */
    box-sizing: border-box;
    /* background-color: rgba(255,0,0,0.1); /* DEBUG: temporary background to see its bounds */
}


/* ... (rest of the eSports.css file remains the same as the previous good version) ... */


/* Headings */
h1 {
    font-size: clamp(32px, 7vw, 48px); /* Responsive */
    color: #ff5733;
    margin-bottom: 20px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center; /* Center main heading */
}

h2 {
    font-size: clamp(28px, 6vw, 36px); /* Responsive */
    color: #00a2ff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 1.5px;
    font-weight: 600;
}

h3 {
    font-size: clamp(22px, 5vw, 28px); /* Responsive */
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.content p {
    text-align: justify;
    line-height: 1.6;
    font-size: clamp(14px, 2.5vw, 16px);
    color: #ccc;
}


/* Custom Purple Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #9b59b6; border-radius: 4px; }
::-webkit-scrollbar-track { background: #141414; }

/* Buttons */
.apply-button {
    display: inline-block;
    padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 20px);
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    margin: 5px;
}

.apply-button:hover {
    background-color: #0056b3;
}

.game-selection-buttons,
.sub-buttons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Custom Classes */
.centered-text { text-align: center; }
.bright-heading { color: #f0f0f0; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); }

/* Roster Blocks Styling */
.roster-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.manager-block,
.player-block,
.academy-block {
    background-color: #2a2a2a;
    overflow: hidden;
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
    height: 100%;
}

.manager-block:hover,
.player-block:hover,
.academy-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
}

.royaleapi-link {
    color: #007bff; text-decoration: none; transition: color 0.3s;
    font-size: clamp(12px, 2vw, 14px);
}
.royaleapi-link:hover { color: #0056b3; text-decoration: underline; }

.manager-block img,
.player-block img,
.academy-block img {
    width: 100%;
    max-width: 150px;
    height: auto;
    object-fit: cover;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    border-radius: 8px;
}

.country {
    margin-bottom: 5px;
    margin-top: 0px;
    font-size: clamp(13px, 2.2vw, 15px);
}
.country img {
    width: 20px; height: auto; margin-right: 5px; vertical-align: middle;
}

.player-tag {
    font-size: clamp(12px, 2vw, 14px);
    color: #aaa; margin-bottom: 5px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.player-tag:hover { color: #fff; text-decoration: underline; }

.w3-center {
    margin-top: 2px; margin-bottom: 2px;
    text-align: center;
}
.manager-block h4, .player-block h4 {
    font-size: clamp(16px, 3vw, 18px) !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}
.manager-block p, .player-block p {
    font-size: clamp(13px, 2.2vw, 14px) !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}

.w3-col.l2, .w3-col.m4, .w3-col.s6 {
    padding: 0 8px;
    box-sizing: border-box;
    display: flex;
}

@media (max-width: 600px) {
    .w3-col.s6 { width: 100%; }
    .manager-block img, .player-block img { max-width: 120px; }
}
@media (min-width: 601px) and (max-width: 992px) {
    .w3-col.m4 { width: 50%; }
    .w3-col.s6 { width: 50%; }
}
@media (min-width: 993px) {
    .w3-col.l2 { width: 33.333%; }
}

/* Collapsible Section Styles */
.collapsible-section {
    margin: 20px 0;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e1e1e;
}

.section-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 15px 20px;
    background-color: #2a2a2a; color: #fff;
    border: none; text-align: left; cursor: pointer;
    transition: background-color 0.3s ease;
}
.section-toggle:hover { background-color: #333; }
.section-toggle i { transition: transform 0.3s ease; margin-left: 10px; }
.section-toggle h2, .section-toggle h3 { margin-bottom: 0; }

.section-content {
    padding: 20px;
    background-color: #222;
    transition: all 0.3s ease;
}

.join-us-content {
    flex-direction: column; align-items: center; gap: 20px;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}
.join-us-content p { text-align: center !important; }

.join-button {
    background: linear-gradient(45deg, #00a2ff, #007bff); color: #fff;
    padding: clamp(10px, 2vw, 12px) clamp(20px, 4vw, 24px);
    font-size: clamp(14px, 2.5vw, 16px);
    border: none; border-radius: 8px; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0, 162, 255, 0.4);
    text-align: center; text-decoration: none;
    margin: 5px;
}
.join-button:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 162, 255, 0.6); }

.tryout-content {
    flex-direction: column; gap: 15px;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}
.tryout-content p { text-align: center !important; }

.tryout-requirements {
    display: flex; flex-wrap: wrap; justify-content: space-around; padding: 15px 0;
}

.tryout-column {
    flex: 1 1 300px;
    max-width: 45%;
    margin: 10px; text-align: center;
    background: rgba(0, 0, 0, 0.2); border-radius: 10px;
    padding: 15px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
@media (max-width: 768px) {
    .tryout-column { max-width: 100%; flex-basis: 100%;}
}
.tryout-column h3 { font-size: clamp(18px, 4vw, 22px); }
.requirement-item {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; justify-content: flex-start;
    font-size: clamp(14px, 2.5vw, 1.1em);
    text-align: left;
}
.requirement-item i { font-size: 1.3em; color: #00a2ff; min-width: 20px; }

.achievements-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a); padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.achievements-content > p { text-align: center !important; }

.team-filter {
    display: flex; justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap; gap: 10px;
}
.team-button {
    background-color: #007bff; border: none; color: white;
    padding: clamp(10px, 2vw, 12px) clamp(15px, 3vw, 24px);
    text-align: center; text-decoration: none; display: inline-block;
    font-size: clamp(14px, 2.5vw, 16px);
    margin: 4px 2px; transition-duration: 0.4s; cursor: pointer;
    border-radius: 8px;
}
.team-button:hover { background-color: white; color: #dc3545; border: 2px solid #dc3545; }
.team-button.active { background-color: #dc3545; color: white; border-color: #dc3545; }
.team-button i { margin-right: 8px; }

.achievement-item {
    background: rgba(0, 0, 0, 0.2); padding: 15px;
    border-radius: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.achievement-item p { margin: 5px 0; text-align: left; font-size: clamp(13px, 2.2vw, 15px); }
.achievement-item i { margin-right: 8px; }
.achievement-item strong { color: #00a2ff; }

.rewards-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a); padding: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
}
.rewards-content > p { text-align: center !important; max-width: 90%;}
.reward-item {
    display: flex; flex-direction: column;
    align-items: flex-start;
    gap: 10px; margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2); padding: 15px;
    border-radius: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%; max-width: 600px;
    text-align: left;
}
.reward-item > span { width: 100%; }
@media (min-width: 600px) {
    .reward-item { flex-direction: row; align-items: center; }
    .reward-item > span { width: auto; }
}
.reward-item i.fa-hand-holding-usd { font-size: 1.5em; color: #00a2ff; margin-right: 10px; }
.reward-list { list-style: none; padding: 0; margin: 10px 0 0 0; width: 100%;}
.reward-list li { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.reward-list li i.fa-percentage { font-size: 1em; color: #00a2ff; }

.donate-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a); padding: 20px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 20px;
}
.donate-content p { text-align: center !important; }
#donate-button-container { display: flex; justify-content: center; width: 100%;}

.twitter-content, .youtube-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a); padding: 10px;
    display: flex; justify-content: center;
}
.twitter-content > div,
.youtube-content iframe {
    max-width: 100%;
    width: 100%;
}
@media (min-width: 768px) {
    .twitter-content > div { width: 600px; }
    .youtube-content iframe { width: 700px; height: calc(700px * 0.5625); }
}
@media (min-width: 992px) {
    .twitter-content > div { width: 800px; }
    .youtube-content iframe { width: 800px; height: calc(800px * 0.5625); }
}

#iframeWrapper {
    margin-top: 20px;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}
#applicationIframe {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    display: block;
}