/* ============================================================
   STREAMHUB+ UI
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --bg: #000;
    --panel: #0a0a0a;
    --border: rgba(255,255,255,0.06);
    --mint: #00ff88;
    --mint-dim: rgba(0,255,136,0.15);
    --white: #fff;
    --grey: #666;
    --grey-light: #999;
    --red: #ff3355;
}

html, body {
    background: var(--bg);
    color: var(--white);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

/* ============ Header ============ */
.app-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo { height: 26px; }

.app-header .header-by {
    font-size: 0.6rem;
    color: var(--grey);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-left: auto;
}

.back-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--mint);
    color: var(--mint);
}

/* ============ Content ============ */
.app-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============ Home grid ============ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 40px;
}

.home-card {
    background: var(--panel);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 36px 20px;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.home-card:hover {
    border-color: var(--mint);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,255,136,0.1);
}

.home-card .icon {
    font-size: 2rem;
    color: var(--mint);
    display: block;
}

.home-card .title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
}

.home-card .sub {
    font-size: 0.7rem;
    color: var(--grey);
    letter-spacing: 1px;
}

/* ============ Loading ============ */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #444;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* ============ Placeholder ============ */
.placeholder {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.placeholder .ph-icon { font-size: 3rem; }

.placeholder .ph-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
}

.placeholder .ph-sub {
    font-size: 0.8rem;
    color: var(--grey);
}

/* ============ Schedule grid ============ */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.event-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 140px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
}

.event-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--grey);
    transition: all 0.3s;
}

.event-card.live::before {
    background: var(--mint);
    box-shadow: 0 0 12px var(--mint);
}

.event-card.upcoming::before { background: #3b9eff; }
.event-card.ended { opacity: 0.5; }

.event-card:hover {
    border-color: rgba(0,255,136,0.15);
    transform: translateY(-2px);
    background: #101010;
}

.event-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.event-sub {
    font-size: 0.7rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 10px;
}

.status {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
}

.status.live {
    background: var(--mint);
    color: #000;
    animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(0,255,136,0); }
}

.status.upcoming {
    background: rgba(59,158,255,0.12);
    color: #3b9eff;
    border: 1px solid rgba(59,158,255,0.2);
}

.status.ended {
    background: rgba(255,255,255,0.04);
    color: var(--grey);
}

.watch-btn {
    background: #fff;
    color: #000;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.watch-btn:hover {
    background: var(--mint);
    box-shadow: 0 0 16px rgba(0,255,136,0.4);
}

/* ============ Poster grid (Movies / Series / Anime) ============ */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.poster-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
    cursor: pointer;
}

.poster-card:hover {
    border-color: var(--mint);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0,255,136,0.1);
}

.poster-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: #1a1a1a;
}

.poster-fallback {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.2);
}

.poster-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    padding: 10px 12px 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.poster-meta {
    font-size: 0.65rem;
    color: var(--grey);
    padding: 0 12px 12px;
}

/* ============ Mobile ============ */
@media (max-width: 700px) {
    .app-header { padding: 12px 14px; }
    .app-content { padding: 14px; }
    .schedule-grid { grid-template-columns: 1fr; }
    .home-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
    .home-card { padding: 28px 20px; }
    .event-card { min-height: 130px; padding: 14px; }
    .poster-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
    .poster-title { font-size: 0.72rem; }
    .poster-meta { font-size: 0.6rem; }
}
