/* The Hundred Live Score - Premium Light Theme with Animations */

.thls-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    color: #1a1a2e;
    position: relative;
}

.thls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.thls-league-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.thls-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e63946;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    animation: thls-live-glow 2.5s ease-in-out infinite;
}

@keyframes thls-live-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.4);
    }
    50% {
        box-shadow: 0 0 12px 4px rgba(230, 57, 70, 0.2);
    }
}

.thls-live-dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: thls-pulse 2s ease-in-out infinite;
}

@keyframes thls-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

.thls-match-status {
    text-align: center;
    padding: 12px 24px;
    font-size: 13px;
    color: #6b7280;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.thls-score-section {
    padding: 28px 24px;
}

.thls-error-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 15px;
}

.thls-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.thls-team {
    flex: 1;
    text-align: center;
}

.thls-team-name {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    transition: background-color 0.5s ease;
}

.thls-team-score {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    transition: background-color 0.5s ease;
    will-change: transform, opacity;
}

.thls-score-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.thls-score-clone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    pointer-events: none;
}

.thls-team-balls {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    transition: background-color 0.5s ease;
}

.thls-vs {
    font-size: 14px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.thls-target {
    text-align: center;
    margin-top: 16px;
    padding: 10px 16px;
    background: #eff6ff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    transition: background-color 0.5s ease;
}

.thls-batters-card,
.thls-bowler-card,
.thls-this-over-card {
    margin: 0 24px 16px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: background-color 0.5s ease;
}

.thls-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.thls-batter-row {
    display: flex;
    gap: 16px;
}

.thls-batter {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: background-color 0.5s ease;
}

.thls-batter-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.5s ease;
}

.thls-batter-stats {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    transition: background-color 0.5s ease;
}

.thls-bowler-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: background-color 0.5s ease;
}

.thls-bowler-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.5s ease;
}

.thls-bowler-overs {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    transition: background-color 0.5s ease;
}

.thls-over-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thls-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.5s ease, border-color 0.5s ease;
    will-change: transform, opacity;
}

.thls-ball-wicket {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.thls-ball-four {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}

.thls-ball-six {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

.thls-ball-new {
    animation: thls-ball-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes thls-ball-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.thls-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #9ca3af;
}

.thls-updated-text {
    font-weight: 500;
    transition: color 0.3s ease;
}

.thls-auto-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
}

.thls-auto-refresh::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: thls-pulse 2s ease-in-out infinite;
}

/* Flash Highlight Animation */
.thls-flash {
    animation: thls-flash-green 1s ease-out;
}

@keyframes thls-flash-green {
    0% { background-color: rgba(34, 197, 94, 0.25); }
    100% { background-color: transparent; }
}

/* Floating Indicators */
.thls-float-indicator {
    position: absolute;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    will-change: transform, opacity;
}

.thls-float-runs {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.thls-float-wicket {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.thls-float-dot {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* Admin Styles */
.thls-admin-wrap {
    max-width: 800px;
}

.thls-admin-wrap h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
}

.thls-admin-wrap .form-table th {
    padding: 20px 10px 20px 0;
    width: 200px;
}

.thls-admin-wrap .form-table td {
    padding: 15px 10px;
}

.thls-admin-wrap input[type="url"] {
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.thls-admin-wrap input[type="url"]:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.thls-admin-wrap .description {
    color: #6b7280;
    font-size: 13px;
    margin-top: 6px;
}

/* Debug Section */
.thls-debug-section {
    margin-top: 32px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.thls-debug-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.thls-debug-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thls-debug-item {
    font-size: 13px;
    line-height: 1.6;
}

.thls-debug-item strong {
    color: #374151;
    font-weight: 600;
}

.thls-debug-item code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #2563eb;
    word-break: break-all;
}

.thls-debug-item pre {
    margin: 8px 0 0 0;
    font-family: 'SF Mono', Monaco, Inconsolata, 'Fira Code', monospace;
}

/* Responsive */
@media (max-width: 480px) {
    .thls-container {
        border-radius: 0;
        margin: 0;
    }

    .thls-header {
        padding: 16px 20px;
    }

    .thls-score-section {
        padding: 20px 16px;
    }

    .thls-team-score,
    .thls-score-clone {
        font-size: 28px;
    }

    .thls-batters-card,
    .thls-bowler-card,
    .thls-this-over-card {
        margin: 0 16px 12px;
        padding: 14px 16px;
    }

    .thls-batter-row {
        flex-direction: column;
        gap: 8px;
    }

    .thls-footer {
        padding: 12px 16px;
    }

    .thls-ball {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Elementor compatibility */
.elementor .thls-container {
    max-width: 100%;
}

/* Gutenberg compatibility */
.wp-block .thls-container {
    max-width: 100%;
}

/* Performance: reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .thls-live-badge,
    .thls-live-dot,
    .thls-auto-refresh::before {
        animation: none;
    }

    .thls-ball,
    .thls-team-score,
    .thls-batter,
    .thls-bowler-row,
    .thls-match-status,
    .thls-target {
        transition: none;
    }

    .thls-flash {
        animation: none;
    }
}
