/* Mobile Optimizations */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* ========================================
   MOBILE RESPONSIVE FIXES - index.php
   ======================================== */

/* Mobile First: Base styles for all screens */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

/* Safe Area for Notched Devices */
@supports (padding: max(0px)) {
    body {
        padding-left: min(0px, env(safe-area-inset-left));
        padding-right: min(0px, env(safe-area-inset-right));
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   MOBILE (320px - 767px)
   ======================================== */

@media (max-width: 767px) {
    /* Container Padding */
    .container,
    .max-w-7xl {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Match Cards - Vertical Layout */
    .match-card,
    .bg-gray-800.rounded-xl.p-6 {
        padding: 12px !important;
        margin-bottom: 12px;
    }

    /* Match Card Grid - Stack Vertically */
    .grid.grid-cols-3 {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px;
    }

    /* Status Column - Full Width */
    .match-status {
        width: 100%;
        text-align: center;
        font-size: 11px !important;
        padding: 4px 8px;
        background: rgba(99, 102, 241, 0.1);
        border-radius: 6px;
    }

    /* Teams Section - Horizontal Layout */
    .teams-section {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 8px;
    }

    /* Team Logos - Smaller */
    .team-logo,
    img[alt*="logo"] {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
    }

    /* Team Names - Wrap & Smaller Font */
    .team-name {
        font-size: 12px !important;
        line-height: 1.3;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Score - Larger & Centered */
    .score,
    .text-2xl.font-bold {
        font-size: 24px !important;
        font-weight: 700;
        min-width: 50px;
        text-align: center;
    }

    /* Date Selector - Better Spacing */
    .date-selector {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 12px 8px;
    }

    .date-selector button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
        font-size: 16px;
    }

    .date-selector input {
        font-size: 14px !important;
        padding: 8px 12px !important;
        min-height: 44px;
    }

    /* Header - Mobile Optimized */
    .header-logo {
        font-size: 1.5rem !important;
    }

    /* Hide Desktop Menu */
    .desktop-menu {
        display: none !important;
    }

    /* Ad Spaces - Prevent Overflow */
    .adsbygoogle {
        max-width: 100% !important;
        overflow: hidden;
    }

    /* AI Badge - Smaller */
    .ai-badge {
        font-size: 9px !important;
        padding: 2px 4px !important;
    }

    /* Buttons - Touch Friendly */
    button,
    .btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Text Sizes */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    /* Spacing */
    .mb-6 {
        margin-bottom: 16px !important;
    }

    .p-6 {
        padding: 12px !important;
    }
}

/* ========================================
   TABLET (768px - 1023px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1023px) {
    .container,
    .max-w-7xl {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    /* Match Cards - 2 Column Grid */
    .match-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .team-logo,
    img[alt*="logo"] {
        width: 40px !important;
        height: 40px !important;
    }

    .team-name {
        font-size: 14px !important;
    }

    .score {
        font-size: 28px !important;
    }
}

/* ========================================
   DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    /* Default desktop styles - no changes needed */
}

/* ========================================
   LOGO STYLES
   ======================================== */

.digital-logo {
    font-family: 'VT323', monospace;
    color: #ff0033;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.8), 0 0 10px rgba(255, 0, 51, 0.5);
    letter-spacing: 2px;
    font-size: 2.25rem;
    line-height: 1;
    text-transform: uppercase;
}

@media (max-width: 767px) {
    .digital-logo {
        font-size: 1.5rem;
    }
}

.digital-suffix {
    font-family: 'VT323', monospace;
    color: #ff0033;
    font-size: 1.5rem;
    text-shadow: 0 0 5px rgba(255, 0, 51, 0.8);
    text-transform: lowercase;
    margin-left: 2px;
}

@media (max-width: 767px) {
    .digital-suffix {
        font-size: 1rem;
    }
}

/* ========================================
   TABLE RESPONSIVE
   ======================================== */

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    10% {
        opacity: 1;
        transform: scale(1.1);
    }

    20% {
        transform: scale(1);
    }

    90% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0);
    }
}

@keyframes flashRed {
    0%, 100% {
        border-color: transparent;
        box-shadow: 0 0 0 transparent;
    }
    50% {
        border-color: #ef4444; /* Red-500 */
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
}

.goal-flash {
    animation: flashRed 1s infinite;
    border: 1px solid transparent; /* Ensure border exists for transition */
    transition: all 0.3s ease;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.goal-animation {
    animation: fadeInScale 40s forwards;
    position: absolute;
    left: 10px;
    top: 45%;
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.goal-animation-team {
    animation: fadeInScale 40s forwards;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
    vertical-align: middle;
    z-index: 50;
    pointer-events: none;
}

.goal-ball {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
    animation: spin 1s linear infinite;
}

.goal-ball-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.goal-ball-img {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0 10px;
    background-color: #1f2937;
    border-radius: 50%;
    padding: 2px;
    filter: brightness(1.3) contrast(1.1);
}

/* ========================================
   AI BADGES
   ======================================== */

.ai-halftime-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}

.ai-halftime-btn:hover {
    transform: scale(1.05);
}

.ai-halftime-btn i {
    font-size: 8px;
}

@media (max-width: 767px) {
    .ai-halftime-btn {
        font-size: 8px;
        padding: 2px 4px;
    }
}

/* ========================================
   STORY MODAL STYLES (Mobile Only)
   ======================================== */
#story-modal {
    transition: opacity 0.3s ease;
}

.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Animations */
.story-slide {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fillBar {
    from { width: 0%; }
    to { width: 100%; }
}

.fill-animation {
    animation: fillBar linear forwards;
}

/* Scrollable Text in Story */
#story-slide-3 {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for story content */
#story-slide-3::-webkit-scrollbar {
    width: 4px;
}
#story-slide-3::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}