/* =========================
   NIXSAHA - MASTER DESIGN
   ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    width: 100%;
    min-height: 100%;
}


body {
    width: 100%;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    background: #0b0b0b;
    color: #ffffff;

    padding-top: 76px;
    padding-bottom: 68px;

    overflow-x: hidden;
}


/* =========================
   MASTER HEADER
   ========================= */

.header {

    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    width: 100%;
    height: 76px;

    padding: 0 28px;

    display: flex;
    align-items: center;

    background: #101010;

    border-bottom: 1px solid #222222;

    z-index: 1000;
}


/* =========================
   LOGO
   ========================= */

.logo {

    width: 200px;

    flex-shrink: 0;

    font-size: 27px;
    font-weight: 900;

    letter-spacing: -1px;

    color: #ffd21c;

    text-decoration: none;

    cursor: pointer;

    display: block;

    outline: none;

    position: relative;

    z-index: 3;
}


a.logo,
a.logo:visited,
a.logo:hover,
a.logo:active,
a.logo:focus {

    color: #ffd21c !important;

    text-decoration: none !important;

    border: none !important;

    outline: none;
}


a.logo:hover {

    color: #ffe066 !important;
}


/* =========================
   SEARCH
   EXACT SCREEN CENTER
   ========================= */

.search-box {

    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: 480px;
    height: 44px;

    display: flex;

    margin: 0;

    z-index: 2;
}


.search-box input {

    flex: 1;

    min-width: 0;

    border: 1px solid #303030;

    border-right: none;

    background: #181818;

    color: #ffffff;

    padding: 0 18px;

    border-radius: 12px 0 0 12px;

    font-size: 14px;

    outline: none;
}


.search-box input::placeholder {

    color: #777777;
}


.search-box input:focus {

    border-color: #ffd21c;
}


.search-box button {

    width: 90px;

    flex-shrink: 0;

    border: none;

    background: #ffd21c;

    color: #111111;

    font-weight: bold;

    border-radius: 0 12px 12px 0;

    cursor: pointer;

    transition: 0.2s;
}


.search-box button:hover {

    background: #ffe066;
}


/* =========================
   HEADER BUTTONS
   ========================= */

.header-buttons {

    width: 260px;

    margin-left: auto;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 12px;

    position: relative;

    z-index: 3;
}


/* Upload */

.upload-header-btn {

    padding: 11px 18px;

    border: none;

    border-radius: 10px;

    background: #ffd21c;

    color: #111111;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;

    white-space: nowrap;

    transition: 0.2s;
}


.upload-header-btn:hover {

    background: #ffe066;
}


/* Sign In */

.header-buttons button:last-child {

    padding: 11px 20px;

    border: 1px solid #ffd21c;

    border-radius: 10px;

    background: transparent;

    color: #ffd21c;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;

    white-space: nowrap;

    transition: 0.2s;
}


.header-buttons button:last-child:hover {

    background: #ffd21c;

    color: #111111;
}


/* =========================
   LAYOUT
   ========================= */

.layout {

    display: flex;

    width: 100%;

    min-height: calc(100vh - 144px);
}


/* =========================
   SIDEBAR
   ========================= */

.sidebar {

    width: 220px;

    padding: 25px 15px;

    background: #101010;

    border-right: 1px solid #222222;

    flex-shrink: 0;
}


.sidebar nav {

    display: flex;

    flex-direction: column;

    gap: 7px;
}


.sidebar a {

    text-decoration: none;

    color: #a5a5a5;

    padding: 14px 16px;

    border-radius: 10px;

    font-size: 14px;

    transition: 0.2s;
}


.sidebar a:hover {

    background: #1c1c1c;

    color: #ffffff;
}


.sidebar a:first-child {

    background: #1c1c1c;

    color: #ffd21c;
}


/* =========================
   MAIN CONTENT
   ========================= */

.main-content {

    flex: 1;

    width: 100%;

    min-width: 0;

    padding: 32px;

    overflow: visible;
}


.main-content h1 {

    font-size: 25px;

    margin-bottom: 28px;

    font-weight: 700;
}


/* =========================
   VIDEO GRID
   ========================= */

.video-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 30px 22px;
}


/* =========================
   VIDEO CARD
   ========================= */

.video-card {

    cursor: pointer;

    min-width: 0;

    transition:
        transform 0.2s;
}


.video-card:hover {

    transform:
        translateY(-4px);
}


/* =========================
   THUMBNAIL
   ========================= */

.thumbnail {

    width: 100%;

    aspect-ratio: 16 / 9;

    background: #191919;

    border: 1px solid #292929;

    border-radius: 14px;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #666666;

    font-size: 13px;

    overflow: hidden;

    transition: 0.2s;
}


.thumbnail img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


.video-card:hover .thumbnail {

    border-color: #444444;
}


/* =========================
   VIDEO TITLE
   ========================= */

.video-card h2 {

    font-size: 16px;

    line-height: 1.4;

    margin-top: 13px;

    margin-bottom: 7px;

    color: #ffffff;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================
   CHANNEL
   ========================= */

.channel-name {

    color: #999999;

    font-size: 13px;

    margin-bottom: 5px;
}


/* =========================
   VIDEO INFO
   ========================= */

.video-info {

    color: #666666;

    font-size: 12px;
}


/* =========================
   MASTER BOTTOM NAVIGATION
   ========================= */

.bottom-navigation {

    position: fixed !important;

    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: 100% !important;

    height: 68px;

    background: #101010;

    border-top: 1px solid #292929;

    box-shadow:
        0 -8px 25px rgba(0, 0, 0, 0.35);

    display: grid !important;

    grid-template-columns:
        repeat(6, 1fr);

    align-items: stretch;

    z-index: 2000 !important;

    box-sizing: border-box;
}


.bottom-navigation a {

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 4px;

    color: #858585;

    text-decoration: none;

    font-size: 11px;

    font-weight: 600;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}


.bottom-navigation a:hover {

    color: #ffd21c;

    background:
        rgba(255, 210, 28, 0.03);
}


.bottom-navigation a.active {

    color: #ffd21c;
}


.bottom-navigation a.active::before {

    content: "";

    position: absolute;

    top: 0;

    left: 50%;

    transform:
        translateX(-50%);

    width: 34px;

    height: 3px;

    background: #ffd21c;

    border-radius:
        0 0 5px 5px;
}


.nav-icon {

    width: 25px;

    height: 25px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 20px;

    line-height: 1;
}


.nav-label {

    white-space: nowrap;
}


/* =========================
   RESPONSIVE - 1000px
   ========================= */

@media (max-width: 1000px) {

    .video-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }


    .search-box {

        width: 420px;

        max-width: 42vw;
    }

}


/* =========================
   RESPONSIVE - 750px
   ========================= */

@media (max-width: 750px) {

    .header {

        padding: 0 18px;
    }


    .logo {

        width: auto;
    }


    .search-box {

        width: 340px;

        max-width: 42vw;
    }


    .header-buttons {

        width: auto;

        gap: 8px;
    }


    .upload-header-btn {

        padding: 10px 13px;
    }


    .header-buttons button:last-child {

        padding: 10px 13px;
    }


    .sidebar {

        width: 180px;
    }


    .main-content {

        padding: 22px;
    }


    .bottom-navigation {

        height: 64px;
    }

}


/* =========================
   RESPONSIVE - 600px
   ========================= */

@media (max-width: 600px) {

    body {

        padding-top: 65px;

        padding-bottom: 62px;
    }


    .header {

        height: 65px;

        padding: 0 12px;
    }


    .logo {

        font-size: 23px;
    }


    .search-box {

        display: none !important;
    }


    .header-buttons {

        width: auto;

        gap: 6px;
    }


    .upload-header-btn {

        padding: 9px 11px;

        font-size: 12px;
    }


    .header-buttons button:last-child {

        padding: 9px 11px;

        font-size: 12px;
    }


    .layout {

        min-height:
            calc(100vh - 127px);
    }


    .sidebar {

        width: 70px;

        padding: 15px 8px;
    }


    .sidebar a {

        font-size: 0;

        text-align: center;

        padding: 15px 5px;
    }


    .main-content {

        padding: 15px;
    }


    .main-content h1 {

        font-size: 21px;
    }


    .video-grid {

        grid-template-columns: 1fr;

        gap: 25px;
    }


    .bottom-navigation {

        height: 62px;
    }


    .bottom-navigation a {

        font-size: 9px;

        gap: 3px;
    }


    .nav-icon {

        width: 23px;

        height: 23px;

        font-size: 18px;
    }

}


/* =========================
   RESPONSIVE - 380px
   ========================= */

@media (max-width: 380px) {

    .bottom-navigation a {

        font-size: 8px;
    }


    .nav-icon {

        font-size: 17px;
    }

}

/* =========================================================
   SHARED BACKEND ACCOUNT / API CARD UI
   ========================================================= */
.account-header-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    font-weight: 800;
}
.account-header-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.account-header-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.nixsaha-api-card { cursor: pointer; }
.nixsaha-card-body { padding: 0 2px 12px; }
.nixsaha-card-creator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 7px;
    font-size: 13px;
    opacity: .82;
}
.nixsaha-mini-avatar {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 11px;
    font-weight: 800;
}
.nixsaha-api-empty {
    padding: 28px;
    border: 1px dashed rgba(255,255,255,.16);
    border-radius: 16px;
    text-align: center;
    opacity: .85;
}
.nixsaha-inline-btn {
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    padding: 9px 15px;
    cursor: pointer;
    font-weight: 700;
}
@media (max-width: 600px) {
    .account-header-btn { width: 38px; height: 38px; min-width: 38px; }
}

.nixsaha-list-remove{margin:8px 2px 12px;padding:7px 10px;border:0;border-radius:9px;background:rgba(255,255,255,.08);color:inherit;cursor:pointer;font-weight:700;font-size:11px}




/* =========================================================
   NIXSAHA API LOADING STATES
   Keep the page visible. Only the content area waiting for
   network data shows a small spinner.
   ========================================================= */
[data-nixsaha-loading] {
    position: relative;
    min-height: 170px;
}

[data-nixsaha-loading] > * {
    visibility: hidden !important;
}

[data-nixsaha-loading]::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(255,255,255,.14);
    border-top-color: #ffd21c;
    border-radius: 50%;
    animation: nixsahaApiSpin .75s linear infinite;
    z-index: 3;
}

[data-nixsaha-loading]::after {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(50% + 30px);
    transform: translateX(-50%);
    color: #777;
    font-size: 11px;
    letter-spacing: .2px;
    white-space: nowrap;
}

@keyframes nixsahaApiSpin {
    to { transform: rotate(360deg); }
}

.video-grid[data-nixsaha-loading] {
    min-height: 260px;
}

/* =========================================================
   COMPACT API LIST CARDS
   Used by History, Liked and Downloads so all three have the
   same smaller horizontal card treatment.
   ========================================================= */
.nixsaha-api-card.compact {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding: 11px;
    margin: 0 0 12px;
    box-sizing: border-box;
    background: #111;
    border: 1px solid #242424;
    border-radius: 14px;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.nixsaha-api-card.compact:hover {
    transform: translateY(-2px);
    border-color: #3b3b3b;
    background: #141414;
}

.nixsaha-api-card.compact .thumbnail {
    flex: 0 0 220px;
    width: 220px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
}

.nixsaha-api-card.compact .nixsaha-card-body {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 4px;
}

.nixsaha-api-card.compact .nixsaha-card-creator {
    margin: 0 0 7px;
}

.nixsaha-api-card.compact .video-title {
    margin: 0 0 7px;
    font-size: 16px;
    line-height: 1.35;
}

.nixsaha-api-card.compact .video-info {
    margin: 0;
}

.nixsaha-api-card.compact .nixsaha-list-remove {
    flex: 0 0 auto;
}

#historyList[data-nixsaha-loading],
#likedList[data-nixsaha-loading],
#videoList[data-nixsaha-loading] {
    min-height: 190px;
}

@media (max-width: 750px) {
    .nixsaha-api-card.compact .thumbnail {
        flex-basis: 180px;
        width: 180px;
    }
}

@media (max-width: 600px) {
    .nixsaha-api-card.compact {
        gap: 11px;
        padding: 9px;
        border-radius: 11px;
    }
    .nixsaha-api-card.compact .thumbnail {
        flex-basis: 135px;
        width: 135px;
        border-radius: 8px;
    }
    .nixsaha-api-card.compact .nixsaha-card-creator {
        display: none;
    }
    .nixsaha-api-card.compact .video-title {
        font-size: 14px;
        margin-bottom: 5px;
    }
    .nixsaha-api-card.compact .nixsaha-list-remove {
        display: none;
    }
}
