/**
 * Match Night Live Frontend Styles
 * 
 * Based on Material UI and Tailwind principles for a clean, modern design
 */

/* Main Container */
.mnl-frontend {
    --mnl-primary: #3f51b5;
    --mnl-primary-dark: #303f9f;
    --mnl-period-bg: rgba(0, 0, 0, 0.2);
    --mnl-secondary: #f50057;
    --mnl-light-bg: #f8f9fc;
    --mnl-dark-text: #263238;
    --mnl-light-text: #ffffff;
    --mnl-border: #e0e0e0;
    --mnl-success: #4caf50;
    --mnl-warning: #ff9800;
    --mnl-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    
    max-width: 600px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    color: var(--mnl-dark-text);
    background-color: var(--mnl-light-bg);
    border-radius: 0.25rem;
    overflow: hidden;
}

/* MVP Card Styling */
.mvp-card {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #FFD700;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    margin: 15px 0;
}

.mvp-header {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mvp-icon {
    font-size: 24px;
}

.mvp-content {
    padding: 16px;
    color: #333;
}

.mvp-content h3 {
    color: #B8860B;
    margin: 0 0 10px 0;
}

.mvp-content .mnl-mvp-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

/* Goal and Penalty Cards */
.mnl-modern-card {
    background-color: var(--mnl-light-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mnl-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mnl-goal-header {
    background-color: var(--mnl-success);
    color: var(--mnl-light-text);
}

.mnl-penalty-header {
    background-color: var(--mnl-warning);
    color: var(--mnl-light-text);
}

.mnl-header-content h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.mnl-header-content h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
}

.mnl-card-body {
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.mnl-player-column {
    width: 80px;
    flex-shrink: 0;
    margin-right: 0;
}

.mnl-player-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mnl-player-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mnl-info-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0; /* Prevent text from pushing container wider than available space */
    overflow-wrap: break-word; /* Ensure long text wraps properly */
    word-break: break-word;
}

.mnl-player-name {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 6px;
    line-height: 1.2;
}

.mnl-assist-info {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 8px;
}

/* Sponsor section styling */
.mnl-sponsor-section {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 8px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mnl-sponsor-label {
    font-size: calc(0.75rem + 5px);
    color: #ffffff;
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}

.mnl-sponsor-image {
    max-width: 100%;
    height: var(--mnl-sponsor-height, 50px);
    max-height: none;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.mnl-sponsor-link {
    display: block;
    width: 100%;
}

/* ============================================
   Loading Skeleton Styles (Phase 1)
   ============================================ */

.mnl-loading-skeleton {
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.mnl-skeleton-scoreboard {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.mnl-skeleton-header,
.mnl-skeleton-badge,
.mnl-skeleton-name,
.mnl-skeleton-score,
.mnl-skeleton-period,
.mnl-skeleton-footer {
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.mnl-skeleton-header {
    height: 30px;
    margin-bottom: 15px;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.mnl-skeleton-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mnl-skeleton-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mnl-skeleton-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.mnl-skeleton-name {
    height: 20px;
    width: 100px;
}

.mnl-skeleton-score {
    height: 50px;
    width: 80px;
    border-radius: 8px;
}

.mnl-skeleton-period {
    height: 25px;
    width: 150px;
    margin: 15px auto;
}

.mnl-skeleton-footer {
    height: 40px;
    width: 100%;
}

.mnl-skeleton-timeline {
    margin-top: 20px;
}

.mnl-skeleton-card {
    height: 120px;
    background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ============================================
   Error State Styles (Phase 1)
   ============================================ */

.mnl-error-state {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border-radius: 8px;
    margin: 20px;
}

.mnl-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.mnl-error-title {
    color: #dc2626;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.mnl-error-message {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 20px;
}

.mnl-error-retry-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mnl-error-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mnl-error-help {
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

.mnl-error-help a {
    color: #3b82f6;
    text-decoration: none;
}

.mnl-error-help a:hover {
    text-decoration: underline;
}

/* ============================================
   Phase 2 Enhancements - Timeline Filtering
   ============================================ */

.mnl-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.mnl-timeline-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mnl-filter-btn {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.mnl-filter-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.mnl-filter-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: white;
}

.mnl-filter-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================
   Phase 2 - Enhanced Empty State
   ============================================ */

.mnl-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    margin: 20px 0;
}

.mnl-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mnl-empty-text {
    font-size: 20px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
}

.mnl-empty-subtext {
    font-size: 14px;
    color: #9ca3af;
}

/* ============================================
   Phase 2 - Relative Timestamps
   ============================================ */

.mnl-event-time,
.card-timestamp {
    cursor: help;
    transition: color 0.2s;
}

.mnl-event-time:hover,
.card-timestamp:hover {
    color: #3b82f6;
}

/* ============================================
   Phase 3 - Goal Animations & Notifications
   ============================================ */

/* Goal card animation - slides in and glows */
@keyframes slideInGoal {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    50% {
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes goalGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8),
                    0 0 60px rgba(255, 215, 0, 0.6),
                    0 0 90px rgba(255, 215, 0, 0.4);
    }
}

@keyframes scaleUp {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Apply animation to NEW goal cards */
.goal-card.mnl-new-goal,
.timeline-item.timeline-goal.mnl-new-goal {
    animation: slideInGoal 0.6s ease-out,
               goalGlow 2s ease-in-out,
               scaleUp 0.4s ease-in-out 0.6s;
}

/* Notification settings panel */
.mnl-notification-settings {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 280px;
}

.mnl-notification-settings h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1f2937;
}

.mnl-notification-settings label {
    display: flex;
    align-items: center;
    margin: 8px 0;
    cursor: pointer;
    font-size: 14px;
}

.mnl-notification-settings input[type="checkbox"] {
    margin-right: 8px;
}

.mnl-notification-settings button {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.mnl-notification-settings button:hover {
    background: #2563eb;
}

.mnl-notification-settings .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    color: #6b7280;
    font-size: 20px;
    padding: 0;
    width: auto;
    margin: 0;
}

/* Notification toggle button */
.mnl-notification-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 9998;
    transition: all 0.3s;
}

.mnl-notification-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* ============================================
   Phase 2 - Mobile Improvements
   ============================================ */

@media (max-width: 768px) {
    .mnl-timeline-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mnl-timeline-filters {
        justify-content: center;
    }
    
    .mnl-filter-btn {
        flex: 1;
        min-width: 70px;
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    /* Remove ALL padding from page containers - NUCLEAR OPTION */
    body,
    html,
    body .mnl-frontend,
    .mnl-frontend,
    .entry-content,
    .site-content,
    article,
    main,
    .site,
    .site-main,
    #primary,
    #content,
    .content-area {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    /* FORCE scoreboard to stay horizontal on mobile */
    .teams,
    .mnl-scoreboard .teams {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
    }
    
    .team {
        flex: 0 0 auto !important;
        max-width: 100px !important;
    }
    
    .score {
        flex: 0 0 auto !important;
        font-size: 28px !important;
        padding: 8px 12px !important;
    }
    
    /* Fix commentary cards - PERFECTLY CENTERED */
    .commentary-card,
    .mnl-timeline-item,
    .timeline-card,
    .goal-card,
    .penalty-card,
    .timeline-item.timeline-goal,
    .timeline-item.timeline-penalty,
    .timeline-item.timeline-text {
        width: 98% !important;
        max-width: 98% !important;
        margin: 0 auto 15px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        position: static !important;
        display: block !important;
        float: none !important;
    }
    
    .mnl-timeline {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .mnl-commentary-section {
        padding: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .mnl-frontend {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Remove theme padding */
    .mnl-frontend > * {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .mnl-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 12px 8px;
    }
    
    .mnl-player-column {
        margin-bottom: 12px;
    }
    
    .mnl-info-column {
        align-items: center;
    }
    
    .mnl-sponsor-image {
        height: var(--mnl-sponsor-height, 40px);
    }
    
    .mnl-sponsor-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Scoreboard Section */
.mnl-scoreboard {
    background: linear-gradient(to right, #a00000, #7a0000);
    color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--mnl-shadow);
    margin-bottom: 1.5rem;
    padding: 20px 30px;
    position: relative;
}

/* Period bar at the top */
.mnl-period-bar {
    background-color: var(--mnl-period-bg);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Match info */
.mnl-match-info {
    font-size: 12px;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
}

/* ===========================
   CUSTOM SCOREBOARD STYLES
   =========================== */

/* Main Scoreboard Container */
.scoreboard {
    width: 700px;
    max-width: 100%;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background: #fff;
    font-family: 'Segoe UI', sans-serif;
}

/* Higher Specificity Override for Theme Conflicts */
.mnl-frontend .scoreboard,
body .scoreboard,
div.scoreboard {
    width: 700px !important;
    max-width: 100% !important;
    margin: 20px auto !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    background: #fff !important;
    font-family: 'Segoe UI', sans-serif !important;
    display: block !important;
}

/* Header with Gradient */
.header {
    background: linear-gradient(to right, #d32f2f, #f44336);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
}

/* Higher Specificity Override for Header */
.mnl-frontend .header,
body .header,
div.header {
    background: linear-gradient(to right, #d32f2f, #f44336) !important;
    color: white !important;
    padding: 15px !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 18px !important;
    display: block !important;
}

/* MAXIMUM SPECIFICITY OVERRIDE - NUCLEAR OPTION */
html body div.mnl-frontend div.scoreboard {
    width: 700px !important;
    max-width: 100% !important;
    margin: 20px auto !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    background: #fff !important;
    font-family: 'Segoe UI', sans-serif !important;
    display: block !important;

}

html body div.mnl-frontend div.scoreboard div.header {
    background: linear-gradient(to right, #d32f2f, #f44336) !important;
    color: white !important;
    padding: 15px !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 18px !important;
    display: block !important;

}

/* NUCLEAR OPTION - ELIMINATE ALL POSSIBLE BACKGROUND SOURCES */
/* Target every possible timeline container combination */
*[class*="timeline"],
*[class*="mnl-timeline"],
*[class*="timeline-item"],
*[class*="mnl-timeline-item"],
*[class*="timeline-content"],
*[class*="mnl-timeline-content"],
*[class*="commentary"],
*[class*="mnl-commentary"],
*[class*="card-goal"],
*[class*="mnl-card-goal"],
*[class*="card-penalty"],
*[class*="mnl-card-penalty"],
*[class*="card-commentary"],
*[class*="mnl-card-commentary"] {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    background-size: auto !important;
    background-position: initial !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    background-origin: padding-box !important;
    background-clip: border-box !important;
    box-shadow: none !important;
    border: none !important;
}

/* FORCE TRANSPARENT BACKGROUNDS ON ALL EVENT CARD CONTAINERS */
html body div.mnl-timeline div.mnl-timeline-item,
html body .mnl-timeline .mnl-timeline-item,
.mnl-frontend .mnl-timeline .mnl-timeline-item,
div.mnl-timeline div.mnl-timeline-item,
.mnl-timeline-item {
    background: transparent !important;
    background-color: transparent !important;
}

html body div.mnl-timeline div.mnl-timeline-item.mnl-card-goal,
html body .mnl-timeline .mnl-timeline-item.mnl-card-goal,
.mnl-frontend .mnl-timeline .mnl-timeline-item.mnl-card-goal,
div.mnl-timeline div.mnl-timeline-item.mnl-card-goal,
.mnl-timeline-item.mnl-card-goal {
    background: transparent !important;
    background-color: transparent !important;
}

html body div.mnl-timeline div.mnl-timeline-item.mnl-card-penalty,
html body .mnl-timeline .mnl-timeline-item.mnl-card-penalty,
.mnl-frontend .mnl-timeline .mnl-timeline-item.mnl-card-penalty,
div.mnl-timeline div.mnl-timeline-item.mnl-card-penalty,
.mnl-timeline-item.mnl-card-penalty {
    background: transparent !important;
    background-color: transparent !important;
}

html body div.mnl-timeline div.mnl-timeline-item.mnl-card-commentary,
html body .mnl-timeline .mnl-timeline-item.mnl-card-commentary,
.mnl-frontend .mnl-timeline .mnl-timeline-item.mnl-card-commentary,
div.mnl-timeline div.mnl-timeline-item.mnl-card-commentary,
.mnl-timeline-item.mnl-card-commentary {
    background: transparent !important;
    background-color: transparent !important;
}

html body div.mnl-timeline div.mnl-timeline-content,
html body .mnl-timeline .mnl-timeline-content,
.mnl-frontend .mnl-timeline .mnl-timeline-content,
div.mnl-timeline div.mnl-timeline-content,
.mnl-timeline-content {
    background: transparent !important;
    background-color: transparent !important;
}

/* ALTERNATIVE APPROACH - HIDE ANY ELEMENT THAT MIGHT BE THE BACKGROUND CARD */
.mnl-timeline-item::before,
.mnl-timeline-item::after,
.mnl-timeline-content::before,
.mnl-timeline-content::after,
*[class*="timeline-item"]::before,
*[class*="timeline-item"]::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Teams Section */
.teams {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
}

.team img.team-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.team img.team-badge:hover {
    transform: scale(1.1);
}

.team-badge-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 2px solid #ddd;
    transition: transform 0.3s ease;
}

.team-badge-placeholder:hover {
    transform: scale(1.1);
}

.team-name {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    color: #333;
}

/* Score Display */
.score {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(to right, #ff5252, #ff1744);
    color: white;
    padding: 10px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.score:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* VS/Period Section */
.vs {
    margin-top: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #444;
    text-align: center;
    padding: 0 20px;
}

/* Footer with Live Status */
.footer {
    background-color: #212121;
    color: #fff;
    padding: 12px;
    text-align: center;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: red;
    animation: pulse 1s infinite;
}

.mnl-status-bar[data-live="false"] .live-dot {
    display: none;
}

.mnl-status-bar[data-live="false"] .mnl-live-text {
    display: none;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .scoreboard {
        width: 95%;
        margin: 10px auto;
    }
    
    .header {
        font-size: 16px;
        padding: 12px;
    }
    
    .teams {
        padding: 15px 0;
        gap: 10px;
    }
    
    .team {
        width: 100px;
    }
    
    .team img.team-badge,
    .team-badge-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .team-name {
        display: none; /* Hide team names on mobile to save space */
    }
    
    .score {
        font-size: 36px;
        padding: 8px 20px;
    }
    
    .footer {
        font-size: 14px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .teams {
        flex-direction: column;
        gap: 20px;
    }
    
    .score {
        order: 2;
        margin: 10px 0;
    }
    
    .team:first-child {
        order: 1;
    }
    
    .team:last-child {
        order: 3;
    }
}

/* Score Flash Animation */
.score.score-updated {
    animation: scoreFlash 1s ease-in-out;
}

@keyframes scoreFlash {
    0%, 100% {
        background: linear-gradient(to right, #ff5252, #ff1744);
        transform: scale(1);
    }
    50% {
        background: linear-gradient(to right, #ff1744, #d50000);
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
    }
}

/* VS/Period Section */
.vs {
    margin-top: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #444;
    text-align: center;
    padding: 0 20px;
}

/* Footer with Live Status */
.footer {
    background-color: #212121;
    color: #fff;
    padding: 12px;
    text-align: center;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: red;
    animation: pulse 1s infinite;
}

.mnl-status-bar[data-live="false"] .live-dot {
    display: none;
}

.mnl-status-bar[data-live="false"] .mnl-live-text {
    display: none;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.mnl-status-bar[data-live="true"] {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #f87171;
}

/* Live Updates Indicator */
.mnl-live-updates-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    animation: liveUpdatesGlow 3s ease-in-out infinite;
}

.mnl-live-pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: livePulse 2s infinite;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

@keyframes livePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes liveUpdatesGlow {
    0% { opacity: 1; }
    70% { opacity: 1; }
    85% { opacity: 0.6; }
    100% { opacity: 1; }
}

.mnl-live-updates-text {
    font-weight: 600;
    font-size: 11px;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Legacy live text (keep for backward compatibility) */
.mnl-live-text {
    font-weight: 700;
    font-size: 12px;
    color: #dc2626;
    letter-spacing: 0.5px;
}

.mnl-period-separator {
    color: #6b7280;
}

.mnl-period-text {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

/* MOBILE RESPONSIVE - NUCLEAR OPTION FOR SCOREBOARD AND CARDS */
@media screen and (max-width: 640px) {
    .mnl-scoreboard-main {
        padding: 16px 8px;
        min-height: 100px;
        max-width: calc(100vw - 20px);
        width: 100%;
    }
    
    /* FORCE SCOREBOARD HORIZONTAL LAYOUT */
    .mnl-scoreboard-row,
    html body .mnl-scoreboard-row,
    div.mnl-scoreboard-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.5rem !important;
    }
    
    .mnl-team-score-container,
    html body .mnl-team-score-container,
    div.mnl-team-score-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .mnl-team-container,
    html body .mnl-team-container,
    div.mnl-team-container {
        margin: 0 0.5rem !important;
        flex-shrink: 0 !important;
    }
    
    .mnl-team-badge {
        width: 50px;
        height: 50px;
    }
    
    .mnl-team-badge img {
        width: 38px;
        height: 38px;
    }
    
    .mnl-badge-placeholder {
        font-size: 24px;
    }
    
    .mnl-team-name {
        font-size: 12px;
        max-width: 70px;
    }
    
    .mnl-score {
        font-size: 28px;
        padding: 6px 10px;
        min-width: 40px;
    }
    
    .mnl-match-info {
        flex-direction: column;
        gap: 6px;
    }
    
    .mnl-league {
        font-size: 14px;
    }
    
    .mnl-match-datetime,
    .mnl-venue {
        font-size: 12px;
    }
    
    /* NUCLEAR OPTION - FORCE GOAL CARDS TO CENTER ON MOBILE */
    .mnl-goal-card,
    .mnl-penalty-card,
    html body .mnl-goal-card,
    html body .mnl-penalty-card,
    html body div .mnl-goal-card,
    html body div .mnl-penalty-card,
    div.mnl-goal-card,
    div.mnl-penalty-card,
    .mnl-frontend .mnl-goal-card,
    .mnl-frontend .mnl-penalty-card,
    .mnl-frontend .mnl-commentary-item .mnl-goal-card,
    .mnl-frontend .mnl-commentary-item .mnl-penalty-card,
    *[class*="goal-card"],
    *[class*="penalty-card"] {
        width: calc(100vw - 20px) !important;
        max-width: 400px !important;
        margin: 0 auto 15px auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        position: relative !important;
        box-sizing: border-box !important;
        right: auto !important;
        float: none !important;
    }
}

.mnl-period {
    padding: 0.5rem 1rem;
    background-color: var(--mnl-period-bg);
    color: var(--mnl-light-text);
    border-radius: 0.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-align: center;
    min-width: 8rem;
}

.mnl-vs {
    font-size: 1rem;
    color: #757575;
}

/* Commentary Section */
.mnl-commentary-section {
    background-color: #ffffff;
    border-radius: 0;
}

.mnl-commentary-header {
    padding: 0.75rem 1.5rem;
    background-color: var(--mnl-primary);
    color: var(--mnl-light-text);
    border-radius: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

.mnl-commentary-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
}

.mnl-commentary-item {
    display: flex;
    padding: 15px;
    margin-bottom: 0; /* Removed margin since we're using gap */
    border: 1px solid var(--mnl-border);
    border-radius: 10px; /* Updated to 10px as requested */
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden; /* Changed to hidden to contain all content */
    width: 100%;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    aspect-ratio: 1 / 1; /* Make it square by default */
    flex-direction: column; /* Stack content vertically */
    box-sizing: border-box;
}

/* All items are now square boxes with equal spacing */
.mnl-commentary-item:last-child {
    margin-bottom: 0;
}

/* Special styling for short text updates */
.mnl-commentary-item.mnl-short-update {
    aspect-ratio: auto; /* Override square aspect ratio */
    max-height: fit-content; /* Allow height to fit content */
    min-height: 80px; /* Minimum height for short updates */
    padding: 12px; /* Slightly reduced padding */
}

/* Ensure content in short updates is properly laid out */
.mnl-short-update .mnl-commentary-content {
    max-height: none;
    overflow-y: visible;
}

.mnl-commentary-item.mnl-goal {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mnl-commentary-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: transparent;
}

.mnl-commentary-item.mnl-goal::before {
    background-color: var(--mnl-success);
}

.mnl-commentary-time {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--mnl-border);
    width: 100%;
}

.mnl-commentary-content {
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-y: auto; /* Enable scrolling for longer content */
    max-height: 100%; /* Take up available space */
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    white-space: normal;
}

/* Ensure images in commentary are properly sized and contained */
.mnl-commentary-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px 0;
}

/* Give goal highlights more space */
.mnl-goal-highlight {
    padding: 10px;
    margin: 5px 0;
    width: 100%;
    box-sizing: border-box;
}

.mnl-commentary-avatar {
    margin-bottom: 0.75rem;
    align-self: center;
}

.mnl-commentary-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mnl-goal {
    font-weight: 600;
}

.mnl-goal-scorer {
    font-weight: 700;
}

.mnl-assist {
    font-style: italic;
    opacity: 0.8;
}

.mnl-sponsor-logo {
    height: var(--mnl-sponsor-height, 60px);
    max-width: 80%;
    margin-bottom: 10px;
    display: block;
    object-fit: contain;
    margin: 0 auto 10px;
}

/* Last Updated Section */
.mnl-last-updated {
    text-align: right;
    font-size: 0.75rem;
    color: #757575;
    padding: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .mnl-teams {
        flex-direction: column;
    }
    
    .mnl-team {
        margin-bottom: 1rem;
        justify-content: center;
    }
    
    .mnl-home-team, .mnl-away-team {
        flex-direction: row;
        text-align: center;
    }
    
    .mnl-match-status {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .mnl-team-name {
        font-size: 1rem;
    }
    
    .mnl-team-badge {
        width: 3rem;
        height: 3rem;
    }
    
    .mnl-team-score {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .mnl-frontend {
        padding: 0.5rem;
    }
    
    .mnl-scoreboard {
        padding: 1rem;
    }
    
    .mnl-team-badge {
        width: 2.5rem;
        height: 2.5rem;
        margin: 0 0.5rem;
    }
    
    .mnl-team-score {
        font-size: 1.75rem;
        padding: 0 0.75rem;
    }
    
    .mnl-period {
        min-width: 6rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* Goal & Special Styling */
.mnl-goal-commentary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
}

.mnl-goal-player-image {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #2196f3;
    flex-shrink: 0;
}

.mnl-goal-player-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mnl-mvp-commentary {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 1rem;
}

.mnl-mvp-image {
    max-width: 200px;
    margin: 0 auto 1rem auto;
}

.mnl-mvp-image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--mnl-shadow);
}

.mnl-mvp-info {
    text-align: center;
}

.mnl-error {
    color: var(--mnl-secondary);
    padding: 1rem;
    text-align: center;
    background-color: #ffebee;
    border-radius: 0.25rem;
    margin: 1rem 0;
}
