/* ===== GLOBAL STYLES & VARIABLES ===== */
:root {
    --primary-color: #E040FB; /* Vibrant Pink/Purple */
    --primary-color-light: rgba(224, 64, 251, 0.4); /* Faded Purple for toggle */
    --dark-bg: #121212;
    --light-bg: #1E1E1E;
    --card-bg: #282828;
    --text-color: #EAEAEA;
    --text-muted: #AAAAAA;
    --border-color: #333333;
}
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
}
html, body {
    height: 100%;
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
}
h1, h2, h3 { 
    line-height: 1.2; font-weight: 600; 
}
a { 
    color: var(--primary-color); text-decoration: none; 
}
.container {
    width: 100%;
    max-width: 1200px; 
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    text-align: center;
}

/* ===== Main Layout & Header ===== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.page-header {
    width: 100%;
    padding: 15px 40px;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 20;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px; 
}
.header-left { flex: 1; justify-content: flex-start; }
.header-right { flex: 1; justify-content: flex-end; }
.branding-logo { 
    display: inline-flex; 
    align-items: center; 
    gap: 15px; 
    text-decoration: none; 
    color: #fff; 
}
.header-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    border: 2px solid var(--primary-color); 
}
.branding-logo h1 { 
    font-size: 1.75rem; 
}
.header-socials { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}
.header-socials a { 
    color: var(--text-muted); 
    font-size: 1.25rem; 
    transition: color 0.3s ease; 
}
.header-socials a:hover { 
    color: #fff; 
}

#toggle-chat-btn {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    vertical-align: middle;
    border-radius: 28px;
    background-color: var(--primary-color); 
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0; 
    color: transparent;
}
#toggle-chat-btn::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    border-radius: 50%;
    background-color: #fff;
    transition: all 0.3s ease;
    transform: translateX(22px);
}
#toggle-chat-btn.off {
    background-color: var(--primary-color-light);
}
#toggle-chat-btn.off::before {
    transform: translateX(0);
}

/* ===== Main Content Area ===== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
#stream-wrapper {
    flex-grow: 1;
    display: flex;
    padding: 20px;
}
.stream-layout-container { 
    display: flex; 
    gap: 20px; 
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}
.video-column { 
    flex: 1 1 auto; 
    min-width: 0; 
}

/* --- THIS IS THE FIX --- */
.twitch-container { 
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* This forces the 16:9 aspect ratio */
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    /* The custom background for the offline state */
    background-image: url('offline-banner.jpg');
    background-size: cover;
    background-position: center;
}
#twitch-embed { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: 2; /* Ensure player is on top of the background image */
}
/* --- END FIX --- */

.chat-column { 
    flex: 0 0 340px; 
    transition: all 0.3s ease; 
    display: flex;
}
.chat-column iframe { 
    border-radius: 12px; 
    flex-grow: 1;
}
#stream-wrapper.chat-hidden .chat-column { 
    display: none; 
}

/* ===== Latest Content & Footer ===== */
#content-feed, footer {
    padding-top: 60px;
    padding-bottom: 60px;
    background-color: var(--light-bg);
}
#content-feed {
    border-top: 1px solid var(--border-color);
}
footer {
    border-top: 1px solid var(--border-color);
}
.tab-btn {
    padding: 10px 25px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tab-btn:hover { color: var(--text-color); border-color: var(--primary-color); }
.tab-btn.active { background-color: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.youtube-links-container { margin-bottom: 30px; }
.youtube-links-container a { font-size: 1.1rem; font-weight: 600; margin: 0 10px; transition: color 0.3s ease; }
.youtube-links-container a:hover { color: var(--secondary-color); }
.tab-buttons { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.content-grid { display: none; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.content-grid.active { display: grid; }
.content-card { background-color: var(--card-bg); border-radius: 12px; overflow: hidden; text-align: left; transition: transform 0.3s ease, box-shadow 0.3s ease; display: block; }
.content-card:hover { transform: translateY(-8px); box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
.content-card img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.content-card.short img { aspect-ratio: 9 / 16; }
.card-info { padding: 20px; }
.card-info h3 { font-size: 1.2rem; color: var(--text-color); margin-bottom: 5px; }
.card-info p { font-size: 0.9rem; color: var(--text-muted); }
footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    body {
        height: auto;
    }
    .main-wrapper, #stream-wrapper {
        height: auto;
        flex-direction: column;
    }
    .main-content {
        height: auto;
    }
    .stream-layout-container { flex-direction: column; }
    .chat-column { width: 100%; height: 500px; }
    .page-header { padding: 10px 20px; }
}
@media (max-width: 768px) {
    .header-left, .header-socials { display: none; }
    .header-right { flex: 1; justify-content: flex-end; }
    .branding-logo h1 { font-size: 1.5rem; }
    .header-avatar { width: 35px; height: 35px; }
    .content-grid { grid-template-columns: 1fr; }
    .tab-buttons { flex-direction: column; gap: 10px; }
}