/**
 * ESPN Basketball Scoreboard Widget Styles
 * 
 * @package Impact_Evaluator
 */

/* ESPN Basketball Scoreboard Container */
.espn-basketball-scoreboard-container {
    position: relative;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}

/* Scoreboard Header */
.scoreboard-header {
    margin-bottom: 20px;
    text-align: center;
}

.scoreboard-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #020244;
    margin: 0;
    padding: 0;
}

/* Error Message */
.espn-scoreboard-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
}

/* No Games Message */
.no-games-message {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-style: italic;
}

/* HeaderScoreboard Carousel */
.HeaderScoreboard__Carousel {
    width: 100%;
    overflow: hidden;
}

.HeaderScoreboard__Carousel__Wrapper {
    width: 100%;
}

.HeaderScoreboard__Events {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Grid Layout */
.HeaderScoreboard__Events.grid-layout {
    display: grid;
    overflow-x: visible;
    gap: 20px;
}

.HeaderScoreboard__Events.grid-layout.columns-1 { grid-template-columns: 1fr; }
.HeaderScoreboard__Events.grid-layout.columns-2 { grid-template-columns: repeat(2, 1fr); }
.HeaderScoreboard__Events.grid-layout.columns-3 { grid-template-columns: repeat(3, 1fr); }
.HeaderScoreboard__Events.grid-layout.columns-4 { grid-template-columns: repeat(4, 1fr); }
.HeaderScoreboard__Events.grid-layout.columns-5 { grid-template-columns: repeat(5, 1fr); }
.HeaderScoreboard__Events.grid-layout.columns-6 { grid-template-columns: repeat(6, 1fr); }

/* Sport Section */
.HeaderScoreboard__SportSection {
    display: contents;
}

/* Score Cell - Original from styles.css */
.ScoreCell {
    flex: 0 0 auto;
    width: 200px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ScoreCell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #020244;
}

.ScoreCell--sm {
    min-height: 120px;
}

.ScoreCell--pre {
    background: #f8f9fa;
}

.ScoreCell:focus {
    outline: 2px solid #020244;
    outline-offset: 2px;
}

/* Match Info - Original from styles.css */
.MatchInfo {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.MatchInfo__Link {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #590000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.MatchInfo__Link:hover {
    color: #020244;
}

/* Score Cell Link - Original from styles.css */
.ScoreCell__Link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 12px;
    height: 100%;
}

.ScoreCell__Link:hover {
    text-decoration: none;
    color: inherit;
}

/* Event Detail - Original from styles.css */
.ScoreCell__Link__Event__Detail {
    display: flex;
    flex-direction: row;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
}

/* Competitor Details - Original from styles.css */
.ScoreCell__CompetitorDetails {
    flex: 1;
}

.ScoreCell__Competitors {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ScoreCell__Item {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Team Logo */
.ScoreCell__Logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
}

.placeholder-logo {
    background: linear-gradient(135deg, #020244 0%, #590000 100%);
    border-radius: 50%;
}

/* Team Info - Original from styles.css */
.ScoreCell__Team {
    text-align: center;
}

.ScoreCell__Truncate {
    /* Original styles preserved */
}

.ScoreCell__TeamName {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #020244;
    line-height: 1.2;
    margin: 0;
}

.ScoreCell__Score {
    font-weight: 700;
    font-size: 18px;
    color: #020244;
    min-width: 30px;
    text-align: center;
    margin-top: 4px;
}

/* Overview - Original from styles.css */
.ScoreCell__Overview {
    flex-shrink: 0;
    text-align: right;
    padding-left: 12px;
}

.ScoreCell__ScoreDate {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #252525;
    margin-bottom: 4px;
}

.ScoreCell__Time {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #666666;
}

/* Game Link Overlay */
.game-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
}

/* Auto Refresh Indicator */
.scoreboard-refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    color: #666666;
}

.refresh-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #020244;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .HeaderScoreboard__Events.grid-layout.columns-4 { grid-template-columns: repeat(2, 1fr); }
    .HeaderScoreboard__Events.grid-layout.columns-5 { grid-template-columns: repeat(2, 1fr); }
    .HeaderScoreboard__Events.grid-layout.columns-6 { grid-template-columns: repeat(2, 1fr); }
    
    .ScoreCell {
        min-width: 250px;
    }
    
    .scoreboard-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .HeaderScoreboard__Events.grid-layout.columns-2 { grid-template-columns: 1fr; }
    .HeaderScoreboard__Events.grid-layout.columns-3 { grid-template-columns: 1fr; }
    .HeaderScoreboard__Events.grid-layout.columns-4 { grid-template-columns: 1fr; }
    .HeaderScoreboard__Events.grid-layout.columns-5 { grid-template-columns: 1fr; }
    .HeaderScoreboard__Events.grid-layout.columns-6 { grid-template-columns: 1fr; }
    
    .ScoreCell {
        min-width: 100%;
    }
    
    .ScoreCell__Link {
        padding: 12px;
    }
    
    .ScoreCell__TeamName {
        font-size: 14px;
    }
    
    .ScoreCell__Score {
        font-size: 16px;
    }
    
    .scoreboard-title {
        font-size: 18px;
    }
}

/* Animation Classes */
.has-animations .game-item {
    opacity: 0;
    transform: translateY(30px);
}

.has-animations .game-item.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* Animation Types */
.has-animations .game-item.fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

.has-animations .game-item.slideInUp {
    animation: slideInUp 0.6s ease forwards;
}

.has-animations .game-item.slideInLeft {
    animation: slideInLeft 0.6s ease forwards;
}

.has-animations .game-item.zoomIn {
    animation: zoomIn 0.6s ease forwards;
}

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

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

@keyframes slideInLeft {
    from { 
        opacity: 0;
        transform: translateX(-30px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading State */
.espn-basketball-scoreboard-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.espn-basketball-scoreboard-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #020244;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Accessibility */
.ScoreCell:focus-within {
    outline: 2px solid #020244;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .ScoreCell {
        border: 2px solid #020244;
    }
    
    .ScoreCell__TeamName,
    .ScoreCell__Score {
        color: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ScoreCell,
    .game-item,
    .refresh-spinner {
        transition: none;
        animation: none;
    }
    
    .has-animations .game-item {
        opacity: 1;
        transform: none;
    }
}

/* NCAA Section Layout Styles - Original from styles.css */
.ncaa-section,
.elementor-widget-impact-evaluator-espn-basketball-scoreboard .ncaa-section {
    background: #ffffff !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.games-slider-wrapper,
.ncaa-section .games-slider-wrapper {
    position: relative !important;
    margin-top: 20px !important;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    gap: 20px !important;
    width: 100% !important;
}

.section-title,
.ncaa-section .section-title {
    grid-column: 1 !important;
    justify-self: start !important;
}

.section-title h2,
.ncaa-section .section-title h2 {
    font-family: 'Poppins', sans-serif !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #020244 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.HeaderScoreboard__Carousel,
.ncaa-section .HeaderScoreboard__Carousel {
    grid-column: 2 !important;
    position: relative !important;
    overflow: hidden !important;
}

.HeaderScoreboard__Carousel__Wrapper,
.ncaa-section .HeaderScoreboard__Carousel__Wrapper {
    position: relative !important;
}

.HeaderScoreboard__Events,
.ncaa-section .HeaderScoreboard__Events {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.HeaderScoreboard__Events::-webkit-scrollbar,
.ncaa-section .HeaderScoreboard__Events::-webkit-scrollbar {
    display: none !important;
}

.HeaderScoreboard__SportSection,
.ncaa-section .HeaderScoreboard__SportSection {
    display: flex !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: transform 0.5s ease !important;
}

/* Slider Navigation - Original from styles.css */
.slider-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.slider-prev,
.slider-next {
    background: rgba(2, 2, 68, 0.9);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.slider-prev:hover,
.slider-next:hover {
    background: #590000;
    transform: scale(1.1);
}

.slider-prev:disabled,
.slider-next:disabled {
    background: rgba(0,0,0,0.3);
    cursor: not-allowed;
    transform: none;
}

.slider-prev {
    left: -20px;
}

.slider-next {
    right: -20px;
}

/* View More Wrapper - Original from styles.css */
.view-more-wrapper {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
}

.view-more-link {
    background: transparent;
    color: #020244;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-more-link:hover {
    color: #590000;
}

/* NCAA Section Responsive */
@media (max-width: 768px) {
    .section-title h2 {
        font-size: 24px;
    }

    .slider-prev,
    .slider-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .slider-prev {
        left: -15px;
    }

    .slider-next {
        right: -15px;
    }

    .view-more-link {
        padding: 10px 25px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .section-title h2 {
        font-size: 20px;
    }

    .slider-navigation {
        display: none; /* Hide navigation on very small screens */
    }

    .view-more-link {
        padding: 8px 20px;
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .espn-basketball-scoreboard-container,
    .ncaa-section {
        background: #ffffff !important;
    }

    .ScoreCell {
        box-shadow: none !important;
        border: 1px solid #000000 !important;
        break-inside: avoid;
    }

    .MatchInfo,
    .scoreboard-refresh-indicator,
    .slider-navigation,
    .view-more-wrapper {
        display: none !important;
    }
}
