
/* =====================================
   VideoFlag
===================================== */

:root {
    --vf-bg: #0B1220;
    --vf-surface: #142438;
    --vf-surface-hover: #1A3048;
    --vf-border: #263C52;
    --vf-primary: #00C8FF;
    --vf-text: #FFFFFF;
    --vf-muted: #8FA3B8;
    --vf-nav-height: 68px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--vf-bg);
    color: var(--vf-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Arial, sans-serif;
}

body {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

/* =====================================
   App Layout
===================================== */

.app-shell {
    min-height: 100vh;
    max-width: 760px;
    margin: 0 auto;
    background: var(--vf-bg);
    position: relative;
}

.app-header {
    height: 66px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 18, 32, .96);
    border-bottom: 1px solid var(--vf-border);
    backdrop-filter: blur(12px);
}

.app-main {
    min-height: calc(100vh - 134px);
    padding: 25px 20px calc(var(--vf-nav-height) + 30px);
}

/* =====================================
   Header / Logo
===================================== */

.brand-button,
.icon-button {
    border: 0;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.brand-button {
    gap: 9px;
    padding: 0;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.4px;
}

.brand-icon {
    width: 31px;
    height: 31px;
    fill: var(--vf-primary);
}

.icon-button {
    width: 44px;
    height: 44px;
    justify-content: center;
    border-radius: 12px;
    color: var(--vf-muted);
}

.icon-button:hover,
.icon-button:focus-visible {
    color: var(--vf-primary);
    background: var(--vf-surface);
}

.icon-button svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
}

/* =====================================
   Screen Management
===================================== */

.screen {
    display: none;
    animation: screen-in .18s ease-out;
}

.screen.active {
    display: block;
}

.screen[hidden] {
    display: none !important;
}

@keyframes screen-in {
    from {
        opacity: .55;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================
   Page Heading
===================================== */

.page-heading {
    margin: 4px 0 22px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--vf-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

h1 {
    margin: 0;
    color: var(--vf-text);
    font-size: 27px;
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.5px;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--vf-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* =====================================
   Category Grid
===================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.category-button {
    min-height: 105px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--vf-border);
    border-radius: 14px;
    background: var(--vf-surface);
    color: var(--vf-text);
    text-align: center;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}

.category-button:hover,
.category-button:focus-visible {
    background: var(--vf-surface-hover);
    border-color: var(--vf-primary);
    outline: none;
}

.category-button:active {
    transform: scale(.98);
}

.category-icon {
    color: var(--vf-primary);
    font-size: 25px;
    line-height: 1;
}

/* =====================================
   Back Button
===================================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--vf-muted);
    font-size: 13px;
    cursor: pointer;
}

.back-button span {
    color: var(--vf-primary);
    font-size: 25px;
    line-height: 15px;
}

.back-button:hover {
    color: var(--vf-text);
}

/* =====================================
   Country List
===================================== */

.country-list {
    display: grid;
    gap: 9px;
}

.country-button {
    width: 100%;
    min-height: 58px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--vf-border);
    border-radius: 12px;
    background: var(--vf-surface);
    color: var(--vf-text);
    text-align: left;
    cursor: pointer;
}

.country-button:hover,
.country-button:focus-visible {
    border-color: var(--vf-primary);
    background: var(--vf-surface-hover);
    outline: none;
}

.country-flag {
    width: 30px;
    font-size: 23px;
    text-align: center;
}

.country-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.row-chevron {
    color: var(--vf-muted);
    font-size: 23px;
}


/* =====================================
   Video List
===================================== */

.video-list {
    display: grid;
    gap: 13px;
}

.video-card {
    width: 100%;
    padding: 0;
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
    border: 1px solid var(--vf-border);
    border-radius: 13px;
    background: var(--vf-surface);
    color: var(--vf-text);
    text-align: left;
    cursor: pointer;
}

.video-card:hover,
.video-card:focus-visible {
    border-color: var(--vf-primary);
    outline: none;
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #16415b, #17243b 65%, #25314a);
    color: rgba(255,255,255,.9);
    font-size: 27px;
}

.video-thumb.alt-1 {
    background: linear-gradient(135deg, #533b62, #1c2a43);
}

.video-thumb.alt-2 {
    background: linear-gradient(135deg, #315b54, #17283d);
}

.video-thumb.alt-3 {
    background: linear-gradient(135deg, #66502d, #202a40);
}

.video-thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-card-content {
    min-width: 0;
    padding: 11px 10px 9px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-card-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 650;
}

.video-card-meta {
    margin-top: 7px;
    color: var(--vf-muted);
    font-size: 11px;
}

.demo-note {
    margin: 18px 0 0;
    color: #71869c;
    font-size: 11px;
    line-height: 1.5;
}

/* =====================================
   Video Player
===================================== */

.player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
}

.player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--vf-muted);
    font-size: 12px;
}

.large-play {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    padding-left: 4px;
    border-radius: 50%;
    background: var(--vf-primary);
    color: #06111d;
    font-size: 22px;
}

.player-info {
    padding-top: 22px;
}

.player-info h1 {
    font-size: 22px;
}

.primary-button {
    min-height: 44px;
    margin-top: 18px;
    padding: 0 18px;
    border: 1px solid var(--vf-primary);
    border-radius: 11px;
    background: rgba(0, 200, 255, .12);
    color: var(--vf-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.primary-button:hover {
    background: rgba(0, 200, 255, .2);
}

/* =====================================
   Favorites
===================================== */

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-state[hidden] {
    display: none;
}

.empty-icon {
    color: var(--vf-primary);
    font-size: 42px;
}

.empty-state h2 {
    margin: 12px 0 6px;
    font-size: 17px;
}

.empty-state p {
    margin: 0;
    color: var(--vf-muted);
    font-size: 12px;
}

/* =====================================
   Settings
===================================== */

.settings-group {
    overflow: hidden;
    border: 1px solid var(--vf-border);
    border-radius: 13px;
    background: var(--vf-surface);
}

.settings-row {
    min-height: 68px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--vf-border);
}

.settings-row:last-child {
    border-bottom: 0;
}

.settings-row strong,
.settings-row span {
    display: block;
}

.settings-row strong {
    font-size: 13px;
    font-weight: 650;
}

.settings-row div span {
    margin-top: 4px;
    color: var(--vf-muted);
    font-size: 11px;
}

.settings-value {
    color: var(--vf-primary);
    font-size: 12px;
}

.version-label {
    margin-top: 22px;
    color: #71869c;
    font-size: 11px;
    text-align: center;
}

/* =====================================
   Bottom Navigation
===================================== */

.bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(var(--vf-nav-height) + env(safe-area-inset-bottom));
    padding: 5px 12px env(safe-area-inset-bottom);
    display: flex;
    justify-content: space-around;
    background: rgba(15, 27, 43, .97);
    border-top: 1px solid var(--vf-border);
    backdrop-filter: blur(12px);
}

.nav-item {
    min-width: 80px;
    padding: 5px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--vf-muted);
    font-size: 10px;
    cursor: pointer;
}

.nav-icon {
    font-size: 22px;
    line-height: 1.1;
}

.nav-item.active {
    color: var(--vf-primary);
}

.nav-item:focus-visible {
    outline: 1px solid var(--vf-primary);
}

/* =====================================
   Responsive
===================================== */

@media (min-width: 600px) {
    .app-main {
        padding-right: 28px;
        padding-left: 28px;
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .country-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
