/* World Cup MVC Football Hub - Mobile-First PWA Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #000000;
    --primary-light: #374151;
    --primary-glow: rgba(0, 0, 0, 0.05);
    --accent: #111827;
    --accent-hover: #374151;
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --font: 'Outfit', sans-serif;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.5;
    padding-bottom: 80px; /* Space for PWA Bottom Navigation */
    min-height: 100vh;
}

.main-wrapper, .admin-layout {
    animation: pageFadeIn 0.4s ease-out forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.logo a {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    background: #000000;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 2px;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Custom Redirect Button (Header) */
.custom-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: #fff;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.custom-btn:hover {
    transform: scale(1.02);
}

/* Category Chips Bar */
.category-bar-wrapper {
    background: var(--bg-dark);
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    position: sticky;
    top: 53px;
    z-index: 99;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.category-bar-wrapper::-webkit-scrollbar {
    display: none; /* Hide scrollbar for clean App look */
}

.category-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    max-width: 800px;
    margin: 0 auto;
}

.category-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.category-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 6px var(--primary-glow);
}

/* Mobile PWA Bottom Navbar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    flex: 1;
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
}

/* Main Layout */
.main-wrapper {
    max-width: 800px; /* Optimized single column for mobile readability */
    margin: 15px auto;
    padding: 0 16px;
}

/* News Cards List */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: row; /* Horizontal style cards for mobile list */
    height: 110px;
    transition: var(--transition);
}

.news-thumb {
    width: 110px;
    min-width: 110px;
    height: 100%;
    background-color: #030712;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    overflow: hidden;
}

.news-category {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}

.news-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 4px 0;
}

.news-excerpt {
    display: none; /* Hide excerpt on listing cards to fit mobile screens */
}

.news-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Sidebar Elements (For Desktop view fallback / styled nicely below grid) */
.sidebar {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
    padding-left: 8px;
}

.widget-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.sidebar-btn {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    display: block;
}

/* Full Article View */
.article-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.article-header {
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 8px 0;
}

.article-hero {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-main);
}

.article-body p {
    margin-bottom: 15px;
}

.article-source-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    transition: var(--transition);
}

/* Footer */
footer {
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 40px;
}

/* Forms & Dashboard */
.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: none;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-table th, .admin-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.alert {
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 15px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* Preloader Overlay */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Soccer ball spinning and bouncing */
.soccer-ball {
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 15px auto;
    animation: spin-and-bounce 1.5s infinite linear;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.soccer-ball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #000000;
    transform: translate(-50%, -50%) rotate(18deg);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.soccer-ball .pattern {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #000000;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.soccer-ball .p1 { top: -2px; left: 50%; transform: translateX(-50%) rotate(180deg); }
.soccer-ball .p2 { bottom: -2px; left: 50%; transform: translateX(-50%); }
.soccer-ball .p3 { top: 18px; left: -2px; transform: rotate(90deg); }
.soccer-ball .p4 { top: 18px; right: -2px; transform: rotate(-90deg); }

@keyframes spin-and-bounce {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(90deg); }
    50% { transform: translateY(0) rotate(180deg); }
    75% { transform: translateY(-15px) rotate(270deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.preloader-text {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Temptation & High-Conversion Click Effects (backer365 Official Site Link)
   ========================================================================== */

/* 1. Header Custom Button - Shiny Fire-Gold Pulse Glow */
.custom-btn[href*="backer365"] {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ff416c, #ff4b2b) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: header-pulse-glow 2s infinite ease-in-out, button-wiggle 6s infinite ease-in-out;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.4);
    z-index: 1;
}

/* Metallic sweeping light effect */
.custom-btn[href*="backer365"]::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.7) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    transform: rotate(30deg);
    animation: metal-sheen 3s infinite ease-in-out;
    z-index: 2;
    pointer-events: none;
}

/* 2. Mobile PWA Bottom Navbar Item - Hot Heartbeat, Red Pulsing Dot & Golden Gradient text */
.bottom-nav-item[href*="backer365"] {
    position: relative;
    animation: nav-heartbeat 2.5s infinite ease-in-out;
}

/* Hot red warning/notification pulsing badge to tempt members */
.bottom-nav-item[href*="backer365"]::before {
    content: 'HOT';
    position: absolute;
    top: -2px;
    right: 18%;
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 6px;
    transform: scale(0.85);
    box-shadow: 0 0 8px rgba(255, 8, 68, 0.6);
    animation: hot-pulse 1.2s infinite alternate;
    z-index: 10;
}

/* Highlight bottom nav svg icon with gold & fire shadow */
.bottom-nav-item[href*="backer365"] svg {
    stroke: #ff4b2b !important;
    filter: drop-shadow(0 0 4px rgba(255, 75, 43, 0.8)) drop-shadow(0 0 1px #ff0844);
    animation: icon-bounce 2.5s infinite ease-in-out;
}

/* Text gets fiery-gold gradient fill */
.bottom-nav-item[href*="backer365"] span {
    font-weight: 800 !important;
    background: linear-gradient(135deg, #ff416c 0%, #ff8a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 1px rgba(255, 75, 43, 0.1));
}

/* Keyframes */
@keyframes header-pulse-glow {
    0% {
        box-shadow: 0 4px 10px rgba(255, 75, 43, 0.4), 0 0 0 0 rgba(255, 75, 43, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 75, 43, 0.7), 0 0 0 6px rgba(255, 75, 43, 0);
    }
    100% {
        box-shadow: 0 4px 10px rgba(255, 75, 43, 0.4), 0 0 0 0 rgba(255, 75, 43, 0);
    }
}

@keyframes metal-sheen {
    0% {
        left: -150%;
    }
    30% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}

@keyframes button-wiggle {
    0%, 90%, 100% {
        transform: rotate(0deg) scale(1);
    }
    92% {
        transform: rotate(-3deg) scale(1.05);
    }
    94% {
        transform: rotate(3deg) scale(1.05);
    }
    96% {
        transform: rotate(-3deg) scale(1.05);
    }
    98% {
        transform: rotate(3deg) scale(1.05);
    }
}

@keyframes nav-heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.08);
    }
    30% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.08);
    }
    60% {
        transform: scale(1);
    }
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

@keyframes hot-pulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 4px rgba(255, 8, 68, 0.6);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(255, 8, 68, 1);
    }
}

/* 3. Automatic Redirect Countdown Banner */
.redirect-banner {
    position: fixed;
    top: -120px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: top 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 14px 24px;
    border-bottom: 2px solid #ff4b2b;
}

.redirect-banner.show {
    top: 0;
}

.redirect-banner-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.redirect-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.redirect-icon-pulse {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 75, 43, 0.15);
    color: #ff4b2b;
}

.redirect-icon-pulse::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ff4b2b;
    animation: beacon 1.5s infinite;
}

.redirect-text {
    font-size: 13px;
    font-weight: 500;
}

.redirect-text strong {
    color: #ff4b2b;
    font-weight: 700;
}

.redirect-countdown-badge {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 13px;
    margin-left: 6px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(255, 75, 43, 0.3);
}

.redirect-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.redirect-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.redirect-btn-go {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #ffffff;
}

.redirect-btn-go:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255, 75, 43, 0.4);
}

.redirect-btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.redirect-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: #ffffff;
}

.redirect-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    width: 100%;
}

@keyframes beacon {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* 4. Text-Only News Card Layout Styles */
.news-card.text-only {
    height: auto;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card.text-only:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    border-left-color: #ff4b2b;
}

.news-card.text-only .news-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-card.text-only .news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-card.text-only .news-category {
    font-size: 11px;
    font-weight: 700;
    color: #ff4b2b;
    background: rgba(255, 75, 43, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.news-card.text-only .news-date {
    font-size: 11px;
    color: var(--text-muted);
}

.news-card.text-only .news-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-main);
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.news-card.text-only .news-title a {
    transition: var(--transition);
}

.news-card.text-only .news-title a:hover {
    color: #ff4b2b;
}

.news-card.text-only .news-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.news-card.text-only .news-read-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.news-card.text-only .news-read-more:hover {
    color: #ff4b2b;
    transform: translateX(3px);
}
