/* /static/css/main.css
   INYOURSPACE.CO.ZA - Main Stylesheet
   Full production version
============================================= */

/* ── CSS Variables ────────────────────────── */
:root {
    --space-dark:    #0a0a1a;
    --space-card:    #12122a;
    --space-border:  #1e1e3a;
    --space-purple:  #6c63ff;
    --space-cyan:    #00d4ff;
    --space-muted:   #aaaacc;
    --space-faint:   #666688;
    --transition:    0.2s ease;
}

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--space-dark);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Navbar ───────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 26, 0.95);      /* ← always visible */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--space-border);
    transition: background var(--transition),
                backdrop-filter var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--space-border);
}
.nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition);
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--space-purple),
        var(--space-cyan)
    );
    transition: width var(--transition);
    border-radius: 2px;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #ffffff;
}

.nav-link.active::after {
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--space-purple),
        var(--space-cyan)
    );
}

/* ── Page Wipe Transition ─────────────────── */
#page-wipe {
    position: fixed;
    inset: 0;
    background: var(--space-dark);
    z-index: 9999;
    pointer-events: none;
    animation: wipeOut 0.4s ease forwards;
}

@keyframes wipeOut {
    0%   { transform: translateX(0);     opacity: 1; }
    100% { transform: translateX(100%);  opacity: 0; }
}

/* ── Hero Section ─────────────────────────── */
.hero-gradient {
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(108, 99, 255, 0.15) 0%,
        rgba(10, 10, 26, 0) 70%
    );
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(
        135deg,
        var(--space-purple) 0%,
        var(--space-cyan)   100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ──────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(
        135deg,
        var(--space-purple),
        #8b5cf6
    );
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform var(--transition),
                box-shadow var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--space-border);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--space-purple);
    background: rgba(108, 99, 255, 0.08);
    transform: translateY(-2px);
}

/* ── Cards ────────────────────────────────── */
.post-card {
    background: var(--space-card);
    border: 1px solid var(--space-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform var(--transition),
                border-color var(--transition),
                box-shadow var(--transition);
    text-decoration: none;
    display: block;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 99, 255, 0.4);
    box-shadow: 0 12px 40px rgba(108, 99, 255, 0.12);
}

.post-card-img-wrap {
    height: 190px;
    overflow: hidden;
}

.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-card-img {
    transform: scale(1.06);
}

.post-card-img-placeholder,
.post-card-img-wrap > div {
    width: 100%;
    height: 100%;
}

.post-placeholder-1 {
    background: linear-gradient(
        135deg, #1f0a0a 0%, #4a1515 100%
    );
}

.post-placeholder-2 {
    background: linear-gradient(
        135deg, #0a1a0a 0%, #154a20 100%
    );
}

.post-placeholder-3 {
    background: linear-gradient(
        135deg, #0a0a2a 0%, #151560 100%
    );
}

/* ── Category Badges ──────────────────────── */
.category-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    background: rgba(108, 99, 255, 0.15);
    color: var(--space-purple);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.category-badge-sm {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: rgba(108, 99, 255, 0.15);
    color: var(--space-purple);
    border: 1px solid rgba(108, 99, 255, 0.3);
}

/* ── Category Colour Variants ─────────────── */
.cat-match-reports,
.cat-rugby,
.cat-cricket {
    background: rgba(255, 107, 107, 0.15) !important;
    color: #ff6b6b !important;
    border-color: rgba(255, 107, 107, 0.3) !important;
}

.cat-blog,
.cat-opinion {
    background: rgba(108, 99, 255, 0.15) !important;
    color: var(--space-purple) !important;
    border-color: rgba(108, 99, 255, 0.3) !important;
}

.cat-lifestyle,
.cat-camping {
    background: rgba(81, 207, 102, 0.15) !important;
    color: #51cf66 !important;
    border-color: rgba(81, 207, 102, 0.3) !important;
}

.cat-audio,
.cat-commentary {
    background: rgba(0, 212, 255, 0.15) !important;
    color: var(--space-cyan) !important;
    border-color: rgba(0, 212, 255, 0.3) !important;
}

.cat-predictor {
    background: rgba(255, 189, 46, 0.15) !important;
    color: #ffbd2e !important;
    border-color: rgba(255, 189, 46, 0.3) !important;
}

/* ── Category Pills ───────────────────────── */
.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.category-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0.08;
}

.category-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.category-pill.cat-rugby {
    background: rgba(255, 107, 107, 0.08);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.25);
}
.category-pill.cat-rugby:hover {
    background: rgba(255, 107, 107, 0.18);
}

.category-pill.cat-blog {
    background: rgba(108, 99, 255, 0.08);
    color: var(--space-purple);
    border-color: rgba(108, 99, 255, 0.25);
}
.category-pill.cat-blog:hover {
    background: rgba(108, 99, 255, 0.18);
}

.category-pill.cat-lifestyle {
    background: rgba(81, 207, 102, 0.08);
    color: #51cf66;
    border-color: rgba(81, 207, 102, 0.25);
}
.category-pill.cat-lifestyle:hover {
    background: rgba(81, 207, 102, 0.18);
}

.category-pill.cat-audio {
    background: rgba(0, 212, 255, 0.08);
    color: var(--space-cyan);
    border-color: rgba(0, 212, 255, 0.25);
}
.category-pill.cat-audio:hover {
    background: rgba(0, 212, 255, 0.18);
}

.category-pill.cat-predictor {
    background: rgba(255, 189, 46, 0.08);
    color: #ffbd2e;
    border-color: rgba(255, 189, 46, 0.25);
}
.category-pill.cat-predictor:hover {
    background: rgba(255, 189, 46, 0.18);
}

/* ── Email Signup ─────────────────────────── */
.email-signup-card {
    background: var(--space-card);
    border: 1px solid var(--space-purple);
    border-radius: 1.5rem;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(108, 99, 255, 0.08);
}

.email-input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid var(--space-border);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition),
                box-shadow var(--transition);
}

.email-input::placeholder {
    color: var(--space-faint);
}

.email-input:focus {
    border-color: var(--space-purple);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

/* ── Scroll Indicator ─────────────────────── */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounceY 2s ease-in-out infinite;
}

.scroll-dot {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(108, 99, 255, 0.6);
    border-radius: 999px;
    position: relative;
}

.scroll-dot::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--space-purple);
    border-radius: 2px;
    animation: scrollDot 1.6s ease-in-out infinite;
}

@keyframes scrollDot {
    0%   { top: 6px;  opacity: 1; }
    100% { top: 22px; opacity: 0; }
}

@keyframes bounceY {
    0%, 100% { transform: translateX(-50%) translateY(0);    }
    50%       { transform: translateX(-50%) translateY(-8px); }
}

/* ── Skeleton Loading ─────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--space-border) 25%,
        #252548 50%,
        var(--space-border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Utility ──────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Smooth Image Loading ─────────────────── */
img {
    transition: opacity 0.3s ease;
}

img[loading] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* ── Focus Styles for Accessibility ──────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--space-purple);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── The Forecast Awakens Button ──────────── */
.forecast-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.3),
        rgba(0, 212, 255, 0.2)
    );
    border: 1px solid rgba(108, 99, 255, 0.5);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.forecast-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.4),
        rgba(0, 212, 255, 0.3)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forecast-btn:hover::before {
    opacity: 1;
}

.forecast-btn:hover {
    border-color: var(--space-cyan);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.4),
                0 0 40px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

/* ── Pulsing glow animation ───────────────── */
@keyframes forecastPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(108, 99, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.8),
                    0 0 40px rgba(0, 212, 255, 0.4);
    }
}

.forecast-btn {
    animation: forecastPulse 3s ease-in-out infinite;
}

/* ── Selection Colour ─────────────────────── */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: #ffffff;
}

/* ── Scrollbar Styling ────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--space-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--space-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--space-purple);
}

/* ── Back to Top Button ───────────────────── */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--space-purple);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 450;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Footer above back-to-top button ─────── */
footer {
    position: relative;
    z-index: 600;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

/* ── Twemoji Size Control ─────────────────── */
img.emoji {
    height: 1.2em;
    width: 1.2em;
    margin: 0 0.05em;
    vertical-align: -0.15em;
    display: inline-block;
}

/* Override for deliberately large emojis */
.emoji-lg img.emoji,
.emoji-lg.emoji {
    height: 3rem;
    width: 3rem;
}

/* ── Group Standings Table ────────────────── */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.standings-table thead tr {
    border-bottom: 1px solid var(--space-border);
}

.standings-table thead th {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.standings-table thead th.col-team,
.standings-table tbody td.col-team {
    text-align: left;
    width: auto;
    min-width: 140px;
}

.standings-table thead th.col-stat,
.standings-table tbody td.col-stat {
    text-align: center;
    width: 36px;
    min-width: 36px;
}

.standings-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.standings-table tbody tr:hover {
    background: rgba(108, 99, 255, 0.06);
}

.standings-table tbody td.col-team {
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.standings-table tbody td.col-stat {
    padding: 0.6rem 0.25rem;
    color: rgba(255, 255, 255, 0.8);
}

.standings-table tbody td.pts {
    font-weight: 800;
    color: #ffffff;
}

.standings-table tbody tr.qualify td.col-team .team-name {
    color: var(--space-cyan);
}

.team-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.team-name {
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

/* ── Predictor - Group Table (standings.html) */
.group-table {
    background: #12122a;
    border: 1px solid #1e1e3a;
    border-radius: 0.75rem;
    overflow: hidden;
}

.group-table-header {
    background: linear-gradient(
        135deg,
        rgba(108, 99, 255, 0.15),
        rgba(0, 212, 255, 0.05)
    );
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: #6c63ff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #1e1e3a;
}

.table-head {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 3rem 3rem 3rem 3rem 3rem 3rem 3rem 3.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #666688;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #1e1e3a;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 3rem 3rem 3rem 3rem 3rem 3rem 3rem 3.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(30, 30, 58, 0.5);
    align-items: center;
    transition: background 0.15s ease;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: rgba(108, 99, 255, 0.05);
}

.table-row.qualifying {
    border-left: 3px solid #2ecc71;
}

.table-cell {
    text-align: center;
    color: #aaaacc;
}

.table-cell.pts {
    font-weight: 800;
    color: #ffffff;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.team-cell .name {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-cell .name.qualifying {
    color: #2ecc71;
}

.group-pairs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .group-pairs-grid {
        grid-template-columns: 1fr;
    }
}