/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Match setup section */
.match-setup {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.match-setup h2 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.team-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.team-input {
    display: flex;
    flex-direction: column;
}

.team-input label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.team-input input {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.team-input input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Score controls */
.score-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.team-control {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.team-control h3 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.score-display {
    text-align: center;
    margin-bottom: 20px;
    font-size: 3em;
    font-weight: bold;
    color: #059669;
}

.score-display .wickets {
    color: #dc2626;
    font-size: 0.8em;
}

.score-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.score-buttons button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-buttons button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.score-buttons button.minus {
    background: #ef4444;
}

.score-buttons button.minus:hover {
    background: #dc2626;
}

.wicket-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.wicket-controls button {
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #f59e0b;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wicket-controls button:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.wicket-controls button.minus {
    background: #ef4444;
}

.wicket-controls button.minus:hover {
    background: #dc2626;
}

/* Cricket-specific overs control */
.overs-control {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #e2e8f0;
}

.overs-label {
    text-align: center;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 14px;
}

.overs-display {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #1e3a8a;
    margin-bottom: 15px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.overs-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.overs-buttons button {
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    background: #8b5cf6;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly minimum */
}

.overs-buttons button:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.overs-buttons button:active {
    transform: scale(0.95);
}

/* Special styling for Complete Over button */
.overs-buttons button.complete-over {
    background: #059669;
    font-weight: 700;
    grid-column: span 1;
}

.overs-buttons button.complete-over:hover {
    background: #047857;
}

.overs-manual {
    display: flex;
    gap: 8px;
    align-items: center;
}

.overs-manual input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    min-height: 44px; /* Touch-friendly */
}

.overs-manual input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.overs-manual button {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: #10b981;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    white-space: nowrap;
}

.overs-manual button:hover {
    background: #059669;
}

/* Quick actions */
.quick-actions {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.quick-actions h3 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-buttons button {
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn {
    background: #ef4444;
    color: white;
}

.reset-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.swap-btn {
    background: #8b5cf6;
    color: white;
}

.swap-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.overlay-btn {
    background: #059669;
    color: white;
}

.overlay-btn:hover {
    background: #047857;
    transform: translateY(-2px);
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
    color: #1e3a8a;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.instructions ol {
    padding-left: 20px;
    line-height: 1.6;
}

.instructions li {
    margin-bottom: 8px;
    color: #374151;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .team-inputs {
        grid-template-columns: 1fr;
    }
    
    .score-controls {
        grid-template-columns: 1fr;
    }
    
    .score-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-display {
        font-size: 2.5em;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    /* Enhanced mobile cricket overs controls */
    .overs-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .overs-buttons button {
        padding: 16px 12px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .overs-buttons button.complete-over {
        grid-column: span 2;
    }
    
    .overs-manual input {
        font-size: 18px;
        min-height: 48px;
    }
    
    .overs-manual button {
        min-height: 48px;
        padding: 14px 20px;
    }
    
    .overs-display {
        font-size: 28px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .team-control {
        padding: 15px;
    }
    
    .match-setup {
        padding: 15px;
    }
    
    .score-display {
        font-size: 2em;
    }
    
    .score-buttons button {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Extra large touch targets for small phones */
    .overs-buttons button {
        min-height: 52px;
        font-size: 18px;
    }
    
    .overs-manual input {
        min-height: 52px;
        font-size: 20px;
    }
    
    .overs-manual button {
        min-height: 52px;
    }
}

/* Loading and transition effects */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

button:active {
    transform: scale(0.95);
}

/* Success indicator */
.success-flash {
    animation: successFlash 0.5s ease-in-out;
}

@keyframes successFlash {
    0% { background-color: inherit; }
    50% { background-color: #10b981; }
    100% { background-color: inherit; }
} 