/* IP2Network v2 - Main Stylesheet */

/* ======= CSS Variables ======= */
:root {
    font-family: ABeeZee, sans-serif;

    /* Colors */
    --color-body: #0a0a0a;
    --color-content: #141414;
    --color-card: #272727;
    --color-card-hover: #2e2e2e;
    --color-footer: #0e0e0e;
    --color-purple: #bb86fc;
    --color-purple-dark: #5d3970;
    --color-white: #fff;
    --color-grey: #868383;
    --color-scrollbar: #1a1a1a;
    --color-scrollbar-thumb: #5d3970;

    /* Text colors */
    --tx-channel-name: #bb86fc;
    --tx-channel-title: #ccc;
    --tx-last-online: #868383;
    --tx-link: #bb86fc;
    --tx-updated: #555;

    /* Fluid font sizes */
    --fs-xs: clamp(10px, 1.5vw, 12px);
    --fs-s: clamp(12px, 2vw, 14px);
    --fs-m: clamp(13px, 2.2vw, 15px);
    --fs-l: clamp(15px, 2.5vw, 20px);
    --fs-xl: clamp(20px, 3vw, 25px);

    /* Spacing */
    --spacer: clamp(6px, 1.2vw, 10px);

    /* Banner */
    --banner-h: clamp(64px, 10vw, 90px);

    /* Card shadow */
    --shadow-card: 3px 3px 3px #0c0c0c, -2px -2px 2px #111;
}


/* ======= Reset & Base ======= */
*, *::before, *::after { box-sizing: border-box; }

html {
    scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar);
}

a {
    text-decoration: none;
    color: var(--tx-link);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-body);
    color: var(--color-white);
    display: grid;
    grid-template-areas:
        "banner   banner   banner"
        ".        content  ."
        "footer   footer   footer";
    grid-template-rows: auto minmax(100vh, 1fr) 40px;
    grid-template-columns: 1fr minmax(auto, 640px) 1fr;
}

body.admin-page {
    grid-template-columns: 1fr minmax(auto, 840px) 1fr;
}


/* ======= Banner ======= */
#banner {
    grid-area: banner;
    height: var(--banner-h);
    background-image:
        url("banner-txt.png"),
        url("banner-bg.png");
    background-repeat: no-repeat;
    background-size: auto 80%, cover;
    background-position: center;
    box-shadow: 0 15px 20px #000;
    filter: brightness(1.5) hue-rotate(35deg);
    position: sticky;
    top: 0;
    z-index: 10;
}


/* ======= Content ======= */
#content {
    grid-area: content;
    background-color: var(--color-content);
    border: 1px solid #000;
    padding-top: 25px;
}


/* ======= Footer ======= */
#footer {
    grid-area: footer;
    padding: 10px 5vw;
    background-color: var(--color-footer);
    font-size: var(--fs-m);
}

#footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 0;
}

#footer .footer-links a {
    padding: 0 10px;
}

#footer .footer-links a:not(:last-child) {
    border-right: 2px ridge var(--color-purple);
}


/* ======= Widget Bar ======= */
.content-widget {
    padding: var(--spacer);
}

.widget-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 20px;
    padding: 10px 0;
    border: 1px solid #000;
    border-radius: 8px;
    background-color: var(--color-card);
}

.widget-item {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    font-size: var(--fs-s);
    text-align: center;
}

.widget-item > div {
    width: 100%;
    border-right: 1px solid #000;
}

.widget-item:last-child > div {
    border-right: none;
}

.item-name {
    color: #bb86fc;
    margin-right: 6px;
}

.item-value {
    color: var(--color-white);
    font-weight: 700;
}


/* ======= Section Titles ======= */
.section-title {
    color: var(--color-white);
    font-size: var(--fs-l);
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-align: center;
    margin: 15px 0;
}

.section-title img {
    vertical-align: middle;
}


/* ======= Channels Container ======= */
.channels {
    padding: 0 var(--spacer);
}


/* ======= Channel Card (shared) ======= */
.channel {
    margin: var(--spacer) 0;
    background-color: var(--color-card);
    display: grid;
    border-radius: 8px;
    overflow: hidden;
    color: var(--tx-channel-name);
    position: relative;
    white-space: nowrap;
}

.channel:hover {
    background-color: var(--color-card-hover);
}

.channel-avatar {
    grid-area: avatar;
    border: 1px solid #000;
    border-radius: 10px;
    overflow: hidden;
    z-index: 1;
    background-color: #774b8c;
}

.channel-avatar img {
    vertical-align: middle;
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
}

.channel-name {
    grid-area: name;
    font-size: var(--fs-l);
    text-indent: 6px;
    margin: auto 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-title {
    color: var(--tx-channel-title);
    grid-area: title;
    font-size: var(--fs-s);
    text-indent: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-viewers {
    grid-area: viewers;
    font-size: var(--fs-m);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.channel-last-online {
    grid-area: last-online;
    align-self: center;
    font-size: var(--fs-s);
    text-align: right;
    color: var(--tx-last-online);
}

.channel-platform {
    grid-area: platform;
    display: flex;
    align-items: center;
    justify-content: center;
    place-self: center;
}

.channel-link {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}


/* ======= Online Channel Card ======= */
.channels-online .channel {
    grid-template-areas:
        "avatar   name     viewers   platform"
        "avatar   title    viewers   platform";
    grid-template-columns: 0fr 16fr 3fr minmax(50px, 2fr);
    grid-template-rows: 50fr 35fr;
}

.channels-online .channel-last-online {
    display: none;
}

.channels-online .channel-avatar {
    width: 6vw;
    min-width: 42px;
    max-width: 52px;
    height: 6vw;
    min-height: 42px;
    max-height: 52px;
}

.channels-online .channel-platform {
    height: 65%;
    width: 80%;
    max-height: 40px;
    min-height: 30px;
}


/* ======= Offline Channel Card ======= */
.channels-offline .channel {
    grid-template-areas:
        "avatar   name   last-online   platform";
    grid-template-columns: 0fr 16fr max-content minmax(50px, 2fr);
    grid-template-rows: 1fr;
}

.channels-offline .channel-title,
.channels-offline .channel-viewers {
    display: none;
}

.channels-offline .channel-avatar {
    min-width: 12px;
    max-width: 35px;
    width: 7vw;
    min-height: 12px;
    max-height: 35px;
    height: 7vw;
}

.channels-offline .channel-platform {
    height: 65%;
    width: 60%;
    max-height: 30px;
    min-height: 25px;
}

.channels-offline .channel-platform-badge {
    filter: grayscale(0.75);
}

.channels-offline .channel-last-online {
    padding-right: 8px;
}


/* ======= Platform Badges ======= */
.channel-platform-badge {
    background-repeat: no-repeat;
    background-size: 80%;
    background-position: center;
    background-color: var(--color-content);
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.badge-youtube {
    background-image: url("badges/yt.svg");
    background-color: #b30909;
    background-size: 80%;
}

.badge-twitch {
    background-image: url("badges/tw.svg");
    background-color: #6441a4;
    background-size: 55%;
}

.badge-kick {
    background-image: url("badges/kick.svg");
    background-color: #2B2C31;
    background-size: 70%;
}

.badge-rumble {
    background-image: url("badges/rumble.svg");
    background-color: #061726;
    background-size: 55%;
}

.badge-dlive {
    background-image: url("badges/dl.svg");
    background-color: #ffd300;
    background-size: 100%;
}

.badge-vaughn {
    background-image: url("badges/vaughn.png");
    background-color: #1a3e66;
    background-size: 80%;
}

.badge-robotstreamer {
    background-image: url("badges/rb.svg");
    background-color: #2b2c31;
    background-size: 100%;
}

.badge-trovo {
    background-image: url("badges/trovo.svg");
    background-color: #080808;
    background-size: 80%;
}

.badge-cozytv {
    background-image: url("badges/cozytv.svg");
    background-color: #001D29;
    background-size: 80%;
}


/* ======= Last Updated ======= */
.last-updated {
    color: var(--tx-updated);
    background-color: #000;
    font-size: var(--fs-xs);
    position: fixed;
    bottom: 0;
    right: 0;
    padding: 3px 5px;
    z-index: 20;
}
