/* Base styles */
body {
    background: #0f0f0f;
    font-family: 'Inter', Arial, sans-serif;
    color: #e0e6ed;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Channel banner styles */
.channel-banner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #181818;
    position: relative;
    padding-bottom: 0;
}

.banner-img-large {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    background: #222;
    border-bottom: 1px solid #232336;
}

.profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: static;
    top: unset;
    margin-bottom: 0;
    gap: 48px;
    margin-top: 32px; /* Add spacing below the banner */
}

.profile-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-img-large {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #181818;
    background: #222;
    box-shadow: 0 2px 16px rgba(127,90,240,0.22);
}

.channel-name {
    margin-top: 14px;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px #000a;
}

/* Top banner (YouTube style) */
.top-banner {
    width: 100%;
    background: #181818;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 10;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.banner-img {
    height: 38px;
    width: auto;
    border-radius: 8px;
    background: #222;
    object-fit: cover;
}

.top-banner h1 {
    margin: 0;
    font-size: 1.45rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.banner-right {
    display: flex;
    align-items: center;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #222;
    background: #222;
    margin-left: 12px;
}

/* Container */
.main-container {
    width: calc(100dvw - 32px);
    max-width: 2000px;
    margin: 24px auto 24px auto;
    background: #181818;
    border-radius: 18px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.28);
    padding: 40px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    box-sizing: border-box;
}

.main-container p {
    font-size: 1.15rem;
    color: #b0b6c2;
    margin-bottom: 12px;
}

/* Responsive iframe container */
iframe {
    width: 100%;
    min-width: 10px;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(127,90,240,0.13);
    border: none;
    
    background: #181818;
    transition: box-shadow 0.18s;
    filter: brightness(0.92) contrast(1.08);
    display: block;
    height: calc(100dvh - 190px);
    min-height: 600px;
    max-height: 100dvh;
}

iframe:focus, iframe:hover {
    box-shadow: 0 4px 24px rgba(127,90,240,0.22);
}

/* Heading */
h1, h2, h3 {
    font-weight: 700;
    margin-top: 0;
    color: #fff;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 32px 0;
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.28);
}

.table th, .table td {
    padding: 18px 20px;
    text-align: left;
}

.table th {
    background: #181818;
    font-weight: 600;
    color: #b0b6c2;
    font-size: 1rem;
}

.table tr:not(:last-child) td {
    border-bottom: 1px solid #232336;
}

.table tr:hover td {
    background: #232336;
}

/* Tag styles */
.tag {
    display: inline-block;
    background: #232336;
    color: #b0b6c2;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 0.95em;
    margin-right: 6px;
    margin-bottom: 2px;
}

/* Checkbox styles */
input[type="checkbox"] {
    accent-color: #7f5af0;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    background: #181818;
    border: 1px solid #444;
}

/* Button styles */
.button {
    background: #222;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    margin-top: 18px;
}

.button:hover {
    background: #333;
    color: #7f5af0;
}

/* Layout for body elements */
header {
    background: #232336;
    color: #fff;
    
    text-align: center;
    box-shadow: 0 2px 12px rgba(127,90,240,0.13);
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
    letter-spacing: 1px;
    color: #fff;
}

main {
    flex: 1;
    width: 100%;
    max-width: 950px;
    margin: 36px auto 24px auto;
    background: #181818;
    border-radius: 18px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.28);
    padding: 40px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
}

main p {
    font-size: 1.15rem;
    color: #b0b6c2;
    margin-bottom: 12px;
}

/* Button group styles */
.iframe-buttons {
    display: flex;
    gap: 0;
    margin: 10px 0 10px 0;
    background: #18122b;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 2px 12px #0002;
    width: fit-content;
    align-self: center;
    position: relative;
}

/* Slider for active button */
.iframe-buttons::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 200px;
    background: linear-gradient(90deg, #3c246e 0%, #7f5af0 100%);
    border-radius: 999px;
    z-index: 0;
    transition: transform 0.35s cubic-bezier(.6,.2,.2,1);
    transform: translateX(var(--slider-x, 0));
    box-shadow: 0 2px 8px #7f5af044;
    pointer-events: none;
}

.iframe-buttons .button {
    background: transparent;
    color: #bdb4e7;
    border: none;
    border-radius: 0;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
    margin: 0;
    outline: none;
    position: relative;
    z-index: 1;
    width: 200px; /* constant width for both buttons */
    box-sizing: border-box;
}

.iframe-buttons .button.active,
.iframe-buttons .button:active {
    /* Remove background from button, handled by slider */
    background: transparent;
    color: #fff;
    border-radius: 999px;
    /* box-shadow: 0 2px 8px #7f5af044; */
}

.iframe-buttons .button:not(.active):hover {
    background: #2d1a4d;
    color: #d1c4f7;
}

/* Footer */
footer {
    
    color: rgb(221, 221, 221);
    text-align: center;
    padding: 18px 0 14px 0;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    line-height: 1.6;
    
    letter-spacing: 0.5px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-logo {
    width: 200px;
    height: 50px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    transition: filter 0.3s;
    filter: invert(1);
}

body.light-theme .footer-logo {
    filter: none;
}

/* Icon links for Discord/Telegram */
.profile-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    transition: transform 0.15s;
}
.profile-icon-link:hover .profile-icon {
    box-shadow: 0 0 0 4px #7f5af0aa;
    transform: scale(1.08);
}

.profile-icon {
    width: 90px;
    height: 90px;
    object-fit: cover;
    box-shadow: 0 1px 8px rgba(0,0,0,0.18);
    transition: box-shadow 0.18s, transform 0.18s;
    border-radius: 10%;
    filter: invert(0);
}

/* Purple glow animation */
@keyframes purple-glow {
    0% {
        box-shadow: 0 0 0 0 #7f5af044, 0 1px 8px rgba(0,0,0,0.18);
    }
    50% {
        box-shadow: 0 0 24px 8px #7f5af0cc, 0 1px 8px rgba(0,0,0,0.18);
    }
    100% {
        box-shadow: 0 0 0 0 #7f5af044, 0 1px 8px rgba(0,0,0,0.18);
    }
}

.profile-icon-link {
    animation: purple-glow 2.2s infinite;
}

/* Purple drop shadow glow animation */
@keyframes drop-shadow-glow {
    0% {
        filter: drop-shadow(0 0 10px #7f5af0cc);
    }
    50% {
        filter: drop-shadow(0 0 24px #7f5af0cc);
    }
    100% {
        filter: drop-shadow(0 0 10px #7f5af0cc);
    }
}

.profile-icon,
.profile-img-large,
.profile-icon-link {
    animation: drop-shadow-glow 2.2s infinite;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-container {
        max-width: 98vw;
        padding: 24px 2vw 24px 2vw;
    }
    iframe {
        height: calc(100dvh - 180px);
        max-height: 100dvh;
    }
}

@media (max-width: 900px) {
    .top-banner {
        padding: 0 10px;
        height: 54px;
    }
    .banner-img {
        height: 28px;
    }
    .profile-img {
        width: 32px;
        height: 32px;
    }
    .main-container {
        max-width: 100vw;
        padding: 1vw 1vw 1vw 1vw;
        border-radius: 10px;
        gap: 18px;
    }
    .table th, .table td {
        padding: 10px 8px;
        font-size: 0.98em;
    }
    h1 {
        font-size: 1.5rem;
    }
    .top-banner h1 {
        font-size: 1rem;
    }
    main {
        max-width: 100%;
        padding: 18px 4vw;
        border-radius: 8px;
    }
    iframe {
        height: calc(100dvh - 120px);
        max-height: 100dvh;
        border-radius: 12px;
    }
    .profile-icon {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 600px) {
    .main-container {
        
        border-radius: 12px;
        gap: 12px;
    }
    iframe {
        height: calc(100dvh - 50px);
        min-height: 600px;
        max-height: 100dvh;
        border-radius: 6px;
        width: 100%;
    }
    .iframe-buttons {
        flex-direction: column;
        gap: 8px;
        width: 200px;
        min-width: 200px;
        align-self: center;
        height: 104px; /* 2 buttons * 48px + gap */
    }
    .iframe-buttons::before {
        width: 100%;
        height: 48px;
        background: linear-gradient(90deg, #3c246e 0%, #7f5af0 100%);
        border-radius: 999px;
        transition: transform 0.35s cubic-bezier(.6,.2,.2,1);
        transform: translateY(var(--slider-y, 0));
        left: 0;
        top: 0;
        box-shadow: 0 2px 8px #7f5af044;
    }
    .iframe-buttons .button {
        width: 100%;
        min-width: 0;
        padding: 12px 0;
        height: 48px;
    }
    footer {
        font-size: 0.95rem;
        padding: 10px 0 8px 0;
    }
    .profile-row {
        gap: 18px;
    }
    .profile-icon {
        width: 38px;
        height: 38px;
    }
    .banner-img-large {
        max-height: 100px;
    }
}

/* Invert and add black drop shadow border for Telegram and Discord icons in light theme */
body.light-theme .profile-row .profile-icon[alt="Telegram"],
body.light-theme .profile-row .profile-icon[alt="Discord"] {
    filter: invert(1) hue-rotate(180deg) saturate(2) drop-shadow(0 0 0px #000) drop-shadow(0 0 4px #000) drop-shadow(0 0 2px #000);
}

/* Light theme for buttons */
body.light-theme .iframe-buttons .button {
    background: transparent; /* Remove white background */
    color: #232336;
}

body.light-theme .iframe-buttons .button.active,
body.light-theme .iframe-buttons .button:active {
    background: transparent;
    color: #fff;
}

body.light-theme .iframe-buttons .button:not(.active):hover {
    background: #eaeaf7;
    color: #7f5af0;
    border: none;
}

/* Light theme overrides */
body.light-theme {
    background: #f7f7fa;
    color: #232336;
}

body.light-theme .channel-banner {
    background: #fff;
}

body.light-theme .banner-img-large {
    background: #eaeaf7;
    border-bottom: 1px solid #eaeaf7;
}



body.light-theme .profile-img-large {
    border: 4px solid #eaeaf7;
    background: #f0f0f7;
    box-shadow: 0 2px 16px rgba(127,90,240,0.08);
}

body.light-theme .channel-name {
    color: #232336;
    text-shadow: 0 2px 8px #eaeaf7;
}

body.light-theme .top-banner {
    background: #f0f0f7;
    box-shadow: 0 1px 8px rgba(127,90,240,0.08);
}

body.light-theme .banner-img {
    background: #eaeaf7;
}

body.light-theme .top-banner h1 {
    color: #232336;
}

body.light-theme .profile-img {
    border: 2px solid #eaeaf7;
    background: #eaeaf7;
}

body.light-theme .main-container {
    background: #fff;
    box-shadow: 0 4px 32px rgba(127,90,240,0.08);
}

body.light-theme .main-container p,
body.light-theme main p {
    color: #444;
}

body.light-theme .table {
    background: #fff;
    box-shadow: 0 1px 4px rgba(127,90,240,0.08);
}

body.light-theme .table th,
body.light-theme .table td {
    color: #444;
}

body.light-theme .table th {
    background: #fff;
}

body.light-theme .table tr:not(:last-child) td {
    border-bottom: 1px solid #eaeaf7;
}

body.light-theme .table tr:hover td {
    background: #eaeaf7;
}

body.light-theme .tag {
    background: #eaeaf7;
    color: #444;
}

body.light-theme input[type="checkbox"] {
    accent-color: #7f5af0;
    background: #fff;
    border: 1px solid #bbb;
}

body.light-theme .button {
    background: #eaeaf7;
    color: #232336;
}

body.light-theme .button:hover {
    background: #d1c4f7;
    color: #7f5af0;
}

body.light-theme header {
    background: #f0f0f7;
    color: #232336;
    box-shadow: 0 2px 12px rgba(127,90,240,0.08);
}

body.light-theme header h1 {
    color: #232336;
}

body.light-theme main {
    background: #fff;
    box-shadow: 0 4px 32px rgba(127,90,240,0.08);
}

/* Light theme for iframe-buttons */
body.light-theme .iframe-buttons {
    background: #f5f4fa;
    box-shadow: 0 2px 12px #bdb4e722;
    border: 1px solid #eaeaf7;
}

body.light-theme .iframe-buttons .button {
    background: transparent; /* Remove white background */
    color: #232336;
    border-radius: 999px;
    box-shadow: none;
    border: none;
    font-weight: 600;
    transition: background 0.18s, color 0.18s;
}

/* Active button (over purple slider) - show white text for contrast */
body.light-theme .iframe-buttons .button.active,
body.light-theme .iframe-buttons .button:active {
    background: transparent;
    color: #fff;
    border-radius: 999px;
    box-shadow: none;
    border: none;
}

/* Hover state for non-active buttons */
body.light-theme .iframe-buttons .button:not(.active):hover {
    background: #eaeaf7;
    color: #7f5af0;
    border: none;
}

/* Fix purple slider animation on white theme */
body.light-theme .iframe-buttons::before {
    background: linear-gradient(90deg, #bdb4e7 0%, #7f5af0 100%);
    box-shadow: 0 2px 12px #7f5af044;
    /* Make sure the slider is visible on white */
    opacity: 1;
}

/* Snowfall canvas overlay (seasonal: Dec–Feb) */
#snow-canvas {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: block;
    border-color: #000;
}

@media (prefers-reduced-motion: reduce) {
    #snow-canvas { display: none; }
}

/* When light theme is active, add a subtle drop-shadow to the canvas
   to help flakes (dark-colored on light theme) pop against very bright pages. */
body.light-theme #snow-canvas {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.14));
}