/* ============================================================
   TV CUBO RETRO MANAGER
   Interface inspirada no padrão visual Jellyfin / TV CUBO
============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top, #172744 0%, #0d1420 36%, #080808 72%);
    color: #fff;

    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
}


/* ============================================================
   APP
============================================================ */

.app-shell {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}


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

.topbar {
    min-height: 118px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 22px;

    padding: 18px 32px;

    border-top: 2px solid rgba(0, 153, 255, .55);

    background:
        linear-gradient(
            180deg,
            rgba(22, 40, 69, .98),
            rgba(13, 22, 36, .96)
        );

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .28);
}


.brand-logo {
    width: 94px;
    max-height: 62px;

    object-fit: contain;

    filter:
        drop-shadow(0 0 9px rgba(0, 181, 255, .38));
}


.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.brand-text h1 {
    margin: 0;

    font-size: 32px;
    line-height: 1;

    letter-spacing: 2px;

    color: #ff6b00;

    text-shadow:
        0 0 13px rgba(255, 107, 0, .4);
}


.brand-text span {
    margin-top: 8px;

    font-size: 14px;

    letter-spacing: 1.2px;

    color: rgba(255, 255, 255, .72);
}


/* ============================================================
   CONTEÚDO
============================================================ */

.main-content {
    flex: 1;

    width: min(1500px, 100%);

    margin: 0 auto;

    padding: 22px 28px 30px;
}


/* ============================================================
   CARDS SUPERIORES
============================================================ */

.cards {
    display: grid;

    grid-template-columns:
        repeat(5, minmax(150px, 1fr));

    gap: 16px;
}


.stat-card {
    min-height: 118px;

    padding: 20px;

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .095),
            rgba(255, 255, 255, .035)
        );

    border:
        1px solid rgba(255, 255, 255, .10);

    box-shadow:
        0 10px 24px rgba(0, 0, 0, .22);

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;
}


.stat-card:hover {
    transform: translateY(-3px);

    border-color: rgba(0, 181, 255, .35);

    background:
        linear-gradient(
            145deg,
            rgba(0, 181, 255, .10),
            rgba(255, 107, 0, .06)
        );
}


.stat-title {
    display: block;

    margin-bottom: 12px;

    font-size: 16px;
    font-weight: 600;

    color: rgba(255, 255, 255, .88);
}


.stat-card strong {
    display: block;

    font-size: 38px;
    line-height: 1;

    color: #20d7ff;
}


/* ============================================================
   SEÇÃO CONSOLES
============================================================ */

.console-section {
    margin-top: 24px;
}


.section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 14px;
}


.section-header h2 {
    margin: 0;

    font-size: 24px;
}


.section-header span {
    font-size: 13px;

    color: rgba(255, 255, 255, .55);
}


#lista-consoles {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(205px, 1fr));

    gap: 13px;
}


.console-card {
    padding: 17px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 107, 0, .10),
            rgba(0, 181, 255, .08)
        );

    border:
        1px solid rgba(255, 255, 255, .09);

    box-shadow:
        0 8px 18px rgba(0, 0, 0, .20);
}


.console-card h3 {
    margin: 0 0 11px;

    font-size: 17px;

    color: #fff;
}


.console-card p {
    margin: 5px 0;

    font-size: 13px;

    color: rgba(255, 255, 255, .72);
}


/* ============================================================
   RODAPÉ
============================================================ */

.footer {
    min-height: 82px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 14px;

    padding: 14px 22px;

    background:
        rgba(5, 5, 5, .86);

    border-top:
        1px solid rgba(255, 255, 255, .06);
}


.footer-logo {
    width: 42px;
    height: 42px;

    object-fit: contain;
}


.footer-info {
    display: flex;
    flex-direction: column;

    gap: 2px;
}


.footer-info strong {
    font-size: 13px;
}


.footer-info span {
    font-size: 11px;

    color: rgba(255, 255, 255, .55);
}


/* ============================================================
   RESPONSIVO
============================================================ */

@media (max-width: 1100px) {

    .cards {
        grid-template-columns:
            repeat(3, minmax(160px, 1fr));
    }
}


@media (max-width: 720px) {

    .topbar {
        min-height: 100px;

        padding: 14px;

        gap: 14px;
    }

    .brand-logo {
        width: 72px;
    }

    .brand-text h1 {
        font-size: 24px;
    }

    .cards {
        grid-template-columns:
            repeat(2, minmax(140px, 1fr));
    }

    .main-content {
        padding: 16px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 5px;
    }
}


@media (max-width: 440px) {

    .cards {
        grid-template-columns: 1fr;
    }

    .footer {
        align-items: flex-start;
    }
}


/* ============================================================
   TOOLBAR / STATUS
============================================================ */

.toolbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.primary-button {
    border:0;
    border-radius:10px;
    padding:11px 18px;
    background:#00a4dc;
    color:#fff;
    font-weight:600;
    font-size:14px;
    cursor:pointer;
    transition:.18s ease;
}

.primary-button:hover {
    filter:brightness(1.12);
    transform:translateY(-1px);
}

.primary-button:disabled {
    opacity:.55;
    cursor:wait;
    transform:none;
}

.status-text {
    font-size:13px;
    color:rgba(255,255,255,.6);
}

.online-text {
    color:#58e58a;
}

.error-text {
    color:#ff6464;
}


/* ============================================================
   SERVIÇOS
============================================================ */

.service-status {
    display:flex;
    flex-wrap:wrap;
    gap:22px;
    margin-top:18px;
    padding:13px 16px;
    border-radius:12px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.07);
    font-size:13px;
}

.service-status > div {
    display:flex;
    align-items:center;
    gap:7px;
}

.dot {
    width:8px;
    height:8px;
    border-radius:50%;
    display:inline-block;
}

.dot.online {
    background:#51e080;
    box-shadow:0 0 8px rgba(81,224,128,.6);
}

.dot.checking {
    background:#f2b84b;
}


/* ============================================================
   AMBIENTE JELLYFIN
============================================================ */

.environment-panel {

    margin-top:18px;

    padding:14px 18px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    border-radius:12px;

    background:
        rgba(255,255,255,.045);

    border:
        1px solid rgba(255,255,255,.07);
}


.environment-main {

    display:flex;

    align-items:center;

    gap:12px;
}


.environment-main > div {

    display:flex;

    flex-direction:column;

    gap:3px;
}


.environment-main strong {

    font-size:14px;
}


.environment-main span {

    font-size:12px;

    color:
        rgba(255,255,255,.55);
}


.environment-details {

    display:flex;

    align-items:center;

    gap:12px;

    font-size:12px;

    color:
        rgba(255,255,255,.6);
}


.environment-badge {

    padding:5px 10px;

    border-radius:7px;

    font-size:11px;

    font-weight:700;

    letter-spacing:1px;
}


.environment-badge.dev {

    background:
        rgba(0,181,255,.13);

    border:
        1px solid rgba(0,181,255,.35);

    color:#44d8ff;
}


.environment-badge.production {

    background:
        rgba(88,229,138,.12);

    border:
        1px solid rgba(88,229,138,.35);

    color:#58e58a;
}


.dot {

    width:9px;

    height:9px;

    border-radius:50%;

    display:inline-block;

    flex:none;
}


.dot.online {

    background:#58e58a;

    box-shadow:
        0 0 9px
        rgba(88,229,138,.65);
}


.dot.offline {

    background:#ff6464;

    box-shadow:
        0 0 9px
        rgba(255,100,100,.55);
}


.dot.checking {

    background:#f3b94f;
}


@media(max-width:720px) {

    .environment-panel {

        align-items:flex-start;

        flex-direction:column;
    }

}


/* ============================================================
   GERENCIADOR DE ARTES V1
============================================================ */

.console-clickable {
    cursor:pointer;
}

.console-open {
    display:block;
    margin-top:12px;
    font-size:12px;
    color:#44d8ff;
}

.games-panel {
    margin-top:26px;
    padding:20px;
    border-radius:16px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.08);
}

.hidden {
    display:none;
}

.games-panel-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:18px;
}

.games-panel-header h2 {
    margin:0 0 4px;
}

.games-panel-header span {
    font-size:12px;
    color:rgba(255,255,255,.55);
}

.secondary-button {
    border:1px solid rgba(255,255,255,.15);
    background:rgba(255,255,255,.06);
    color:#fff;
    border-radius:9px;
    padding:9px 14px;
    cursor:pointer;
}

.games-list {
    display:flex;
    flex-direction:column;
    gap:8px;
}

.game-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;

    padding:12px 14px;

    border-radius:10px;

    background:rgba(255,255,255,.035);

    border:1px solid rgba(255,255,255,.05);
}

.game-name {
    display:flex;
    flex-direction:column;
    gap:3px;
}

.game-name strong {
    font-size:14px;
}

.game-name span {
    font-size:11px;
    color:rgba(255,255,255,.45);
}

.game-art-status {
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:8px;
}

.art-ok,
.art-missing {
    padding:5px 8px;
    border-radius:7px;
    font-size:11px;
}

.art-ok {
    color:#58e58a;
    background:rgba(88,229,138,.08);
}

.art-missing {
    color:#ffba5c;
    background:rgba(255,186,92,.08);
}

@media(max-width:720px) {

    .game-row {
        align-items:flex-start;
        flex-direction:column;
    }

    .game-art-status {
        justify-content:flex-start;
    }
}


/* ============================================================
   PREVIEW / APLICAÇÃO DE ARTES
============================================================ */

.game-clickable {
    cursor:pointer;
}

.game-open {
    color:#44d8ff;
    font-size:11px;
    white-space:nowrap;
}

.art-panel {
    margin-top:26px;
    padding:20px;
    border-radius:16px;
    background:rgba(255,255,255,.045);
    border:1px solid rgba(255,255,255,.08);
}

.art-panel-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:18px;
}

.art-panel-header h2 {
    margin:0 0 4px;
}

.art-panel-header span {
    font-size:12px;
    color:rgba(255,255,255,.55);
}

.art-preview-grid {
    display:grid;
    grid-template-columns:
        repeat(3,minmax(0,1fr));
    gap:16px;
}

.art-preview-card {
    padding:15px;
    border-radius:13px;
    background:rgba(255,255,255,.035);
    border:1px solid rgba(255,255,255,.06);
}

.art-preview-card h3 {
    margin:0 0 12px;
    font-size:15px;
}

.art-preview-card label {
    display:block;
    margin-top:10px;
    font-size:12px;
    color:rgba(255,255,255,.7);
}

.art-image-frame {
    height:280px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    border-radius:10px;
    background:#090909;
}

.art-image-frame img {
    width:100%;
    height:100%;
    object-fit:contain;
}

.art-logo-frame {
    height:180px;
}

.art-bg-frame {
    height:220px;
}

.art-unavailable {
    display:none;
}

.art-actions {
    display:flex;
    align-items:center;
    gap:16px;
    margin-top:18px;
}

@media(max-width:900px) {

    .art-preview-grid {
        grid-template-columns:1fr;
    }

    .art-image-frame {
        height:240px;
    }
}
