/**
 * Idaho Sports Data Plugin Styles
 */

/* Base styles */
.isd-shortcode-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.isd-shortcode-title {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.isd-no-data, .isd-error {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-style: italic;
}

.isd-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Games grid layout */
.isd-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin: 0;
}

.isd-game-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.isd-game-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-date-time {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.game-date {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.game-time {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

.game-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.team-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 5px;
    border-radius: 4px;
}

.team-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: middle;
}

.team-name {
    font-size: 0.85em;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    margin-bottom: 3px;
    display: block;
}

.team-score {
    font-size: 1.1em;
    font-weight: bold;
    display: block;
}

.vs-separator {
    padding: 0 10px;
    color: #666;
    font-size: 0.8em;
    font-weight: 500;
}

.game-stream {
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.stream-link {
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 115, 170, 0.1);
    transition: background-color 0.3s ease;
}

.stream-link:hover {
    background: rgba(0, 115, 170, 0.2);
    text-decoration: none;
}

/* Table styles */
.isd-schedule-table, .isd-standings-table {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.isd-table-header {
    display: grid;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    font-weight: 600;
    font-size: 0.85em;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.isd-schedule-table .isd-table-header {
    grid-template-columns: 1fr 2fr 1fr;
}

.isd-standings-table .isd-table-header {
    grid-template-columns: 2fr 1fr 1fr;
}

.isd-table-header > div {
    padding: 12px 15px;
}

.isd-table-row {
    display: grid;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.isd-schedule-table .isd-table-row {
    grid-template-columns: 1fr 2fr 1fr;
}

.isd-standings-table .isd-table-row {
    grid-template-columns: 2fr 1fr 1fr;
}

.isd-table-row:hover {
    background: rgba(0, 115, 170, 0.05);
}

.isd-table-row:last-child {
    border-bottom: none;
}

.isd-table-row > div {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    font-size: 0.9em;
}

.col-date {
    color: #666;
    font-size: 0.85em;
}

.col-opponent {
    font-weight: 500;
}

.col-result {
    font-weight: 600;
    color: #0073aa;
}

.col-team {
    font-weight: 500;
}

.col-record {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-weight: 600;
    color: #0073aa;
}

.col-conference {
    color: #666;
    font-size: 0.85em;
}

/* Statistics grid */
.isd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 0;
}

.stat-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-item.full-width {
    grid-column: 1 / -1;
    text-align: left;
    padding: 15px 20px;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #0073aa;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-text {
    color: #333;
    font-weight: 500;
}

/* Widget specific styles */
.isd-latest-scores-widget .isd-scores-list {
    margin: 0;
}

.isd-latest-scores-widget .isd-game-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.isd-latest-scores-widget .isd-game-item:last-child {
    border-bottom: none;
}

.isd-latest-scores-widget .game-date {
    min-width: 40px;
    font-size: 0.75em;
    color: #666;
    text-align: center;
}

.isd-latest-scores-widget .game-matchup {
    flex: 1;
    margin-left: 12px;
    display: flex;
    align-items: center;
    font-size: 0.85em;
}

.isd-latest-scores-widget .team-info {
    display: flex;
    align-items: center;
    margin: 0 8px;
}

.isd-latest-scores-widget .team-name {
    margin-right: 8px;
}

.isd-latest-scores-widget .team-score {
    font-weight: bold;
    color: #0073aa;
    min-width: 20px;
    text-align: center;
}

.isd-latest-scores-widget .game-separator {
    color: #999;
    font-size: 0.8em;
    margin: 0 4px;
}

.isd-latest-scores-widget .team-logo {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.isd-latest-scores-widget .game-stream {
    margin-top: 8px;
    text-align: center;
}

.isd-latest-scores-widget .stream-link {
    font-size: 0.75em;
}

/* Responsive design */
@media (max-width: 768px) {
    .isd-games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-teams {
        flex-direction: column;
        gap: 8px;
    }
    
    .vs-separator {
        padding: 5px 0;
    }
    
    .isd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .isd-table-header, .isd-table-row {
        font-size: 0.8em;
    }
    
    .isd-table-header > div, .isd-table-row > div {
        padding: 10px 12px;
    }
    
    .isd-latest-scores-widget .game-matchup {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .isd-latest-scores-widget .team-info {
        justify-content: space-between;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .isd-shortcode-container {
        margin: 15px 0;
    }
    
    .isd-game-card {
        padding: 12px;
    }
    
    .team-name {
        font-size: 0.8em;
    }
    
    .stat-number {
        font-size: 1.6em;
    }
    
    .isd-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .isd-game-card, .isd-schedule-table, .isd-standings-table, .stat-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .isd-shortcode-title {
        color: #e2e8f0;
    }
    
    .team-name, .col-opponent, .col-team {
        color: #e2e8f0;
    }
    
    .game-date, .col-date, .col-conference {
        color: #a0aec0;
    }
    
    .isd-table-header {
        background: #4a5568;
        color: #cbd5e0;
    }
    
    .isd-table-row:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}