:root {
    --bg: #0A0C10;
    --surface: #12151C;
    --surface-2: #1B1F29;
    --surface-3: #232838;
    --border: #262B38;
    --text: #EDEFF4;
    --text-dim: #8A90A0;
    --text-faint: #565C6C;
    --accent: #FF5A36;
    --signal: #34D399;
    --danger: #FF5A5A;
    --radius: 8px;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #090b10;
    color: #fff;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}


/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient( circle at top, #24294a 0, #090b10 55% );
}

.login-card {
    width: min(420px, calc(100% - 40px));
    padding: 40px;
    background: rgba(22, 25, 36, .96);
    border: 1px solid #303545;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .5);
}

.logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient( 135deg, #7c4dff, #00c6ff );
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
}

.login-card h1 {
    margin: 0;
    font-size: 30px;
}

.subtitle {
    color: #9ca3b4;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #c9ceda;
    font-size: 14px;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    color: white;
    background: #10131c;
    border: 1px solid #343949;
    border-radius: 10px;
    outline: none;
}

.form-control:focus {
    border-color: #7957ff;
}

.login-button {
    width: 100%;
    margin-top: 10px;
    padding: 13px;
    border-radius: 10px;
    color: white;
    background: linear-gradient( 135deg, #704cff, #4e7bff );
    cursor: pointer;
}


/* Main */
.main-container {
    min-height: 100vh;
    background: #090b10;
}

.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    background: #10131b;
    border-bottom: 1px solid #242836;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
}

.brand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient( 135deg, #704cff, #00b7ff );
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #9ca3b4;
}

.topbar-button {
    padding: 8px 15px;
    color: #ddd;
    background: #1b1f2a;
    border-radius: 8px;
    cursor: pointer;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 7px 10px;
    min-width: 180px;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    width: 100%;
}


/* Content */
.content {
    max-width: 1400px;
    margin: auto;
    padding: 40px 30px;
}

.content-full {
    height:100%;
    max-width: 1400px;
    margin: auto;
    padding: 40px 30px;
}

.hero {
    padding: 30px 0;
}

.hero h1 {
    margin-bottom: 8px;
    font-size: 38px;
}

.hero p {
    color: #9299aa;
}


/* Main type cards */
.type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
    grid-template-rows: 1fr;
    min-height: 65vh;
}

.type-card {
    min-height: 230px;
    padding: 30px;
    text-align: left;
    color: white;
    border-radius: 18px;
    cursor: pointer;
    transition: transform .2s, border-color .2s;
}

.type-card:hover {
    transform: translateY(-4px);
}

.type-card.live {
    background: linear-gradient( 135deg, #182c48, #111724 );
    border: 1px solid #23558b;
}

.type-card.movies {
    background: linear-gradient( 135deg, #42233f, #17121d );
    border: 1px solid #71375f;
}

.type-card.series {
    background: linear-gradient( 135deg, #203d35, #121c19 );
    border: 1px solid #306854;
}

.type-icon {
    font-size: 45px;
    margin-bottom: 25px;
}

.type-card h2 {
    margin: 0 0 5px;
}

.type-card span {
    color: #a8afbf;
}


/* Sections */
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.section-header h1 {
    margin: 0;
}

.back-button {
    padding: 8px 13px;
    color: #d5d9e3;
    background: #171b25;
    border: 1px solid #2a3040;
    border-radius: 8px;
    cursor: pointer;
}


/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 80px;
    padding: 18px;
    text-align: left;
    color: white;
    background: #131720;
    border: 1px solid #252b38;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s;
}

.category-card:hover {
    background: #1b2030;
}

.category-icon {
    font-size: 25px;
}


/* Media */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.media-card {
    overflow: hidden;
    padding: 0;
    text-align: left;
    color: white;
    background: #131720;
    border: 1px solid #252b38;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .2s, border-color .2s;
}

.media-card:hover {
    transform: translateY(-4px);
    border-color: #6550db;
}

.media-image {
    width: 100%;
    height: 240px;
    background: #1b1f29;
}

.media-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
}

.media-title {
    min-height: 55px;
    padding: 12px;
    box-sizing: border-box;
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* Episodes */
.description {
    max-width: 700px;
    color: #9299aa;
    line-height: 1.5;
}

.season-title {
    margin-top: 30px;
    margin-bottom: 12px;
}

.episode-grid {
    display: grid;
    gap: 10px;
}

.episode-card {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 14px;
    color: white;
    text-align: left;
    background: #131720;
    border: 1px solid #252b38;
    border-radius: 10px;
    cursor: pointer;
}

.episode-card:hover {
    background: #1b2030;
}

.episode-number {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #292245;
    color: #a994ff;
    font-weight: bold;
}

.episode-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.episode-info span {
    color: #7f8798;
    font-size: 13px;
}


/* -------------------------- */
.season-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.season-tabs button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
}

.season-tabs button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.episode-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
}

.episode-row:hover {
    border-color: var(--accent);
}

.episode-num {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
}
/* -------------------------- */


.play-icon {
    margin-left: auto;
    color: #917dff;
}


/* Player */
.player-container {
    max-width: 1200px;
    margin: auto;
    padding: 30px;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

    .player-header h2 {
        margin: 0;
    }

.video-player {
    display: block;
    width: 100%;
    max-height: 75vh;
    background: black;
    border-radius: 12px;
}

.player-url {
    padding-top: 12px;
    color: #777f91;
}


/* Loading */
.loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #aab1c1;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #343a4b;
    border-top-color: #795cff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Errors */
.error-message {
    margin-top: 15px;
    padding: 12px;
    color: #ffb4b4;
    background: #321c21;
    border: 1px solid #67313b;
    border-radius: 8px;
}

.page-error {
    margin-top: 30px;
}


/* Mobile */
@media (max-width: 700px) {

    .topbar {
        padding: 0 15px;
    }

    .username {
        display: none;
    }

    .content {
        padding: 25px 15px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .type-grid {
        grid-template-columns: 1fr;
    }

    .type-card {
        min-height: 160px;
    }

    .item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .media-image {
        height: 190px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .player-container {
        padding: 15px;
    }
}


/* -------------------------- */
/*--- Custom-Toast Styles --- */
#toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Positions */
#toast-container.top-left {
    top: 20px;
    left: 20px;
    align-items: flex-start;
}

#toast-container.top-right {
    top: 20px;
    right: 20px;
    align-items: flex-end;
}

#toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
    align-items: flex-start;
}

#toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
    align-items: flex-end;
}

#toast-container.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
}

/* Toast */
.toast {
    position: relative;
    min-width: 280px;
    max-width: 420px;
    padding: 15px 42px 15px 18px;
    border-radius: 8px;
    color: white;
    background: #333;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    /* Important for multiline content */
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Types */
.toast.success {
    background: #22c55e;
}

.toast.error {
    background: #ef4444;
}

.toast.info {
    background: #3b82f6;
}

.toast.warning {
    background: #f59e0b;
}

/* Close button */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toast-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}
/*--- Custom-Toast Styles --- */
/* -------------------------- */
