/* 
   Al Qadia Momken — Sophisticated Dark Theme
   Based on premium dashboard aesthetic
*/

:root {
    --red: #C8102E;
    --gold: #C5A059;
    --bg: #0A0A0A;
    --card-bg: #151515;
    --text-dim: #8E8E8E;
    --font-serif: 'Playfair Display', 'Georgia', serif;
    --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-arabic-emotional: 'Amiri', serif;
    --font-arabic-title: 'Cairo', sans-serif;
    --border: rgba(255, 255, 255, 0.05);
    --footer-height: 64px;
}

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

/* Prevent any element from causing horizontal scroll */
html {
    overflow-x: hidden;
}

/* FIX 1: min-height instead of height so content can grow freely.
   FIX 2: padding-bottom reserves space for the fixed footer. */
body {
    background-color: var(--bg);
    color: #fff;
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--footer-height);
    overflow-x: hidden;
}

/* ─── Layout Architecture ─────────────────────────────────────────── */

.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* FIX 3: flex:1 fills remaining viewport height inside the body flex container. */
    flex: 1;
}

/* ─── Hero Section (Left) ─────────────────────────────────────────── */

.hero-section {
    position: relative;
    padding: 80px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: radial-gradient(circle at 10% 30%, rgba(200, 16, 46, 0.1), transparent 50%);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.hero-section::-webkit-scrollbar {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 48px;
    width: 100%;
}

.hero-arabic {
    font-family: var(--font-arabic-emotional);
    font-size: 88px;
    line-height: 1.1;
    color: var(--red);
    filter: drop-shadow(0 0 15px rgba(200, 16, 46, 0.3));
    margin-bottom: 8px;
    direction: rtl;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 48px;
    opacity: 0.9;
}

/* ─── Logo Circle ─────────────────────────────────────────────────── */

.logo-circle {
    position: absolute;
    top: 40px;
    left: 60px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
    z-index: 3;
}

/* ─── Timer Grid ──────────────────────────────────────────────────── */

.timer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 520px;
}

/* seconds card */
.timer-box:last-child {
    grid-column: 1 / 2;
    margin: 0;
}

.timer-box {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 4px;
    border: 1px solid rgba(197, 160, 89, 0.1);
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.timer-box:hover {
    border-color: var(--gold);
}

.timer-value {
    font-size: 32px;
    font-weight: 300;
    display: block;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.timer-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.fridays-wrap {
    margin-top: 32px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.fridays-val {
    font-size: 24px;
    color: var(--gold);
    font-weight: 600;
}

.fridays-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.legendary-rtl-block {
    margin-top: 64px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 2px solid var(--red);
    padding-right: 24px;
}

.rtl-phrase {
    color: var(--text-dim);
    font-size: 18px;
    opacity: 0.8;
}

.rtl-name {
    color: var(--red);
    font-size: 48px;
    line-height: 1;
}

.rtl-quote {
    color: var(--gold);
    font-size: 24px;
    font-style: italic;
}

/* ─── Sidebar (Right) ─────────────────────────────────────────────── */

.sidebar {
    background: #0D0D0D;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    gap: 48px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* ─── Section Title ───────────────────────────────────────────────── */

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: rgba(197, 160, 89, 0.15);
    margin-left: 15px;
}

/* ─── Match Details ───────────────────────────────────────────────── */

.match-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.score-card-refined {
    background: rgba(200, 16, 46, 0.05);
    border: 1px solid rgba(200, 16, 46, 0.15);
    padding: 24px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.team-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.team-name {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.score-digit {
    font-size: 48px;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
}

.score-divider {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 18px;
    color: var(--gold);
    opacity: 0.5;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #fff;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

/* ─── Timeline ────────────────────────────────────────────────────── */

.sidebar-timeline {
    position: relative;
    padding-left: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-item-refined {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item-refined::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 4px;
    width: 9px;
    height: 9px;
    background: #222;
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.timeline-item-refined.active::before {
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
}

.goal-time {
    font-size: 12px;
    color: var(--red);
    font-weight: 700;
    margin-bottom: 2px;
}

.goal-scorer {
    font-size: 20px;
    margin-bottom: 2px;
}

.goal-team {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── Context Cards ───────────────────────────────────────────────── */

.context-grid-refined {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: auto;
}

.context-card-refined {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
    border: 1px solid var(--border);
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.theme-footer {
    height: var(--footer-height);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    background: var(--bg);
    z-index: 10;
}

.italic-quote {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--gold);
    font-size: 13px;
}

.copyright {
   font-size: 10px;
   opacity: 0.6;
}

/* ─── Animations ──────────────────────────────────────────────────── */

.glow-ball {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(193, 39, 45, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: slowMove 25s infinite alternate linear;
    will-change: transform;
}

@keyframes slowMove {
    from { transform: translate(-20%, -20%); }
    to   { transform: translate(20%, 20%); }
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.2;
    pointer-events: none;
    animation: float 15s infinite linear;
}

@keyframes float {
    0%   { transform: translateY(0) rotate(0deg);      opacity: 0; }
    50%  { opacity: 0.4; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Tablet (≤ 992px): stack columns ────────────────────────────── */
@media (max-width: 992px) {
    body {
        padding-bottom: 0;
        overflow-x: hidden;
    }

    .main-layout {
        grid-template-columns: 1fr;
        height: auto;
        flex: none;
    }

    .hero-section {
        padding: 60px 24px 40px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        /* overflow:hidden clips the 600px glow-ball and particles */
        overflow: hidden;
    }

    .hero-content {
        padding-top: 56px;
    }

    .hero-arabic {
        font-size: 64px;
    }

    .timer-grid {
        max-width: 100%;
    }

    .sidebar {
        padding: 40px 24px;
        background: var(--bg);
        overflow-x: hidden;
    }

    .theme-footer {
        position: static;
        height: auto;
        flex-direction: column;
        padding: 24px;
        gap: 12px;
        text-align: center;
    }

    .logo-circle {
        left: 24px;
        top: 16px;
    }
}

/* ─── Small mobile (≤ 480px) ──────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-section {
        padding: 56px 16px 32px;
    }

    .hero-arabic {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .timer-grid {
        gap: 12px;
    }

    .timer-value {
        font-size: 28px;
    }

    .timer-box {
        padding: 18px;
    }

    .rtl-name {
        font-size: 36px;
    }

    .rtl-quote {
        font-size: 18px;
    }

    .legendary-rtl-block {
        margin-top: 40px;
    }

    .sidebar {
        padding: 32px 16px;
    }

    .score-card-refined {
        padding: 16px;
    }

    .score-digit {
        font-size: 36px;
    }

    .logo-circle {
        left: 16px;
        top: 12px;
    }
}

/* ─── Extra-small (≤ 360px) ───────────────────────────────────────── */
@media (max-width: 360px) {
    .hero-arabic {
        font-size: 40px;
    }

    .timer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .timer-value {
        font-size: 20px;
    }
}
