/* score.css */

.score-container {
    padding: 30px !important; /* Force use default glass padding */
    height: auto;
    display: block;
    min-height: 600px;
}

#scoreSetupView, #scoreLiveView {
    padding: 0; /* Remove extra padding since container has it */
    max-width: 1200px;
    margin: 0; /* Align left */
}

@media (max-width: 992px) {
    .score-container {
        padding: 20px !important;
        margin-bottom: 40px; /* Bottom margin for mobile tiles */
    }
    
    #scoreSetupView, #scoreLiveView {
        margin: 0 auto;
    }
}

.score-setup-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 800px;
}

.match-history-section {
    margin-top: 40px;
}

.section-title {
    font-family: var(--font-family-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--gold-highlight);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.team-setup label {
    display: block;
    font-size: 12px;
    color: var(--gold-highlight);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

.vs-divider {
    font-family: var(--font-family-display);
    font-size: 24px;
    font-weight: 900;
    color: var(--text-muted);
    padding-top: 20px;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    letter-spacing: 2px;
}

/* Live Scoring View Header */
.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Horizontal Split Layout */
.score-split-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 400px;
}

.team-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 15px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#matchTimer {
    font-family: var(--font-family-display);
    font-size: 28px;
    font-weight: 900;
    color: var(--gold-primary);
    letter-spacing: 2px;
    min-width: 80px;
    text-align: center;
}

.btn-start-timer {
    background: var(--gold-primary);
    color: #000;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start-timer:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(197, 160, 101, 0.4);
}

.btn-start-timer.running {
    background: var(--danger);
    color: white;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.btn-danger-sm {
    background: rgba(217, 48, 37, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-sm:hover {
    background: var(--danger);
    color: white;
}

.team-a {
    background: linear-gradient(135deg, rgba(197, 160, 101, 0.08) 0%, transparent 100%);
}

.team-b {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.team-info {
    text-align: center;
    margin-bottom: 25px;
}

.team-header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.team-info h2 {
    font-family: var(--font-family-display);
    font-size: 22px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.team-a h2 {
    color: var(--gold-primary) !important;
}

.team-b h2 {
    color: var(--white) !important;
}

.team-b .team-score {
    color: #ff4d4d !important; /* Red score for opponent */
    text-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

.team-undo-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.undo-team-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.undo-team-btn span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.team-score {
    font-family: var(--font-family-display);
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    margin: 15px 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    color: var(--gold-primary);
}

.team-role {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Score Buttons */
.score-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: auto;
}

.score-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 85px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 10px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.score-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.15);
}

.btn-val {
    font-family: var(--font-family-display);
    font-size: 32px;
    font-weight: 800;
}

.btn-lbl {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.8;
}

.team-a .score-btn { border-left: 4px solid var(--gold-primary); }
.team-b .score-btn { border-right: 4px solid var(--white); }

.batting-5 { background: rgba(197, 160, 101, 0.12); border-color: var(--gold-primary); }
.fielding-10 { background: rgba(255, 255, 255, 0.08); border-color: var(--white); }

/* Footer Controls */
.score-footer-controls {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--glass-border);
}

.btn-full {
    width: 100%;
    padding: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--gold-gradient);
    color: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 160, 101, 0.4);
}

/* Match Cards in History */
.match-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gold-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.match-card:hover::before {
    opacity: 0.03;
}

.match-card-header, .match-teams, .click-hint {
    position: relative;
    z-index: 1;
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 12px;
}

.match-date {
    color: var(--text-muted);
    font-weight: 600;
}

.live-badge {
    background: rgba(217, 48, 37, 0.1);
    color: #ff4d4d;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 1.5px;
    border: 1px solid rgba(217, 48, 37, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.match-teams .team:first-child { align-items: flex-start; }
.match-teams .team:last-child { align-items: flex-end; }

.team-name {
    font-family: var(--font-family-display);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 5px;
}

.team-score {
    font-family: var(--font-family-display);
    font-size: 32px;
    font-weight: 900;
    color: var(--gold-primary);
    text-shadow: 0 2px 10px rgba(197, 160, 101, 0.3);
}

.vs {
    font-family: var(--font-family-display);
    font-weight: 900;
    color: var(--text-muted);
    font-size: 14px;
}

.click-hint {
    margin-top: 15px;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--gold-highlight);
    font-weight: 700;
    letter-spacing: 1px;
}

.match-live {
    border-left: 4px solid var(--danger);
    cursor: pointer;
}

.match-finished {
    border-left: 4px solid var(--glass-border);
}

.match-delete-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(217, 48, 37, 0.1);
    border: 1px solid rgba(217, 48, 37, 0.3);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.match-card:hover .match-delete-btn {
    opacity: 1;
}

.match-delete-btn:hover {
    background: var(--danger);
    color: white;
}

/* Event Log */
.event-log-container h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.event-log {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    height: 120px;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
}

.log-time { color: var(--text-muted); margin-right: 10px; }
.log-text { flex: 1; }
.log-points { font-weight: 700; color: var(--gold-primary); }

@media (max-width: 992px) {
    .score-split-layout {
        flex-direction: row; /* Keep horizontal for scoring */
        gap: 10px;
        min-height: 500px;
    }
    
    .team-side {
        padding: 15px;
    }
    
    .team-info h2 { font-size: 18px; }
    .team-score { font-size: 48px; }
    
    .score-btn {
        height: 75px;
    }
    
    .btn-val { font-size: 26px; }
}

@media (max-width: 480px) {
    .setup-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .vs-divider { padding-top: 0; }
    
    .team-score { font-size: 56px; }
    .score-split-layout { min-height: 520px; }
}

/* Accessibility */
.score-btn:focus-visible {
    outline: 3px solid var(--gold-primary);
    outline-offset: 2px;
}
