/* Snooker Shot Tracker - Main Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: white;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    opacity: 0.8;
    font-size: 1.1rem;
}

.section {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
}

.section h2 {
    margin-bottom: 20px;
    color: #ffd700;
}

.section h3 {
    margin-bottom: 15px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 5px;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab.active {
    background: rgba(255,215,0,0.2);
    color: #ffd700;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #ffd700;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* Game Interface */
.game-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.player-card {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.player-card.active {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.player-name {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.player-score {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

/* Shot Recording Flow */
.shot-flow {
    max-width: 400px;
    margin: 0 auto;
}

.shot-step {
    display: none;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.shot-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #ffd700;
    font-weight: bold;
}

.shot-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.shot-type-btn {
    padding: 20px 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shot-type-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.shot-type-btn.pot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.shot-type-btn.safety {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.shot-type-btn.snooker {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ball-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ball-btn {
    padding: 15px 8px;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ball-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Ball Colors */
.ball-btn.red { background: linear-gradient(135deg, #dc2626, #991b1b); }
.ball-btn.yellow { background: linear-gradient(135deg, #eab308, #a16207); color: #000; text-shadow: none; }
.ball-btn.green { background: linear-gradient(135deg, #16a34a, #15803d); }
.ball-btn.brown { background: linear-gradient(135deg, #a3683c, #8b4513); }
.ball-btn.blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.ball-btn.pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.ball-btn.black { background: linear-gradient(135deg, #374151, #111827); }

.result-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.result-btn {
    padding: 25px 15px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.result-btn.good {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.result-btn.ok {
    background: linear-gradient(135deg, #FF9800 0%, #e68900 100%);
    color: white;
}

.result-btn.bad {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.flow-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.flow-btn {
    padding: 12px 25px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.flow-btn.back {
    background: #666;
    color: white;
}

.flow-btn.confirm {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.flow-btn:hover {
    transform: translateY(-2px);
}

.current-selection {
    background: rgba(255,215,0,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,215,0,0.3);
}

.current-selection h4 {
    color: #ffd700;
    margin-bottom: 10px;
}

.selection-item {
    padding: 5px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    display: inline-block;
    margin: 3px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .shot-type-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ball-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .result-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .shot-flow {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .shot-type-btn,
    .result-btn {
        min-height: 70px;
        font-size: 1rem;
    }
    
    .ball-btn {
        min-height: 50px;
        font-size: 0.8rem;
    }
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

.stat-label {
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.8;
}

/* Shot History */
.recent-shots {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.shot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.shot-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.shot-quality {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.quality-good { background: #4CAF50; }
.quality-ok { background: #FF9800; }
.quality-bad { background: #f44336; }

/* Tables */
.match-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.match-table th,
.match-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.match-table th {
    background: rgba(255,215,0,0.1);
    color: #ffd700;
    font-weight: bold;
}

.match-table tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

.match-table .winner {
    color: #4CAF50;
    font-weight: bold;
}

.match-table .loser {
    opacity: 0.7;
}

/* Utility Classes */
.error {
    background: rgba(244, 67, 54, 0.2);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.loading {
    text-align: center;
    padding: 20px;
    opacity: 0.7;
}

.add-player-form {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.add-player-form.show {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .shot-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .shot-btn {
        padding: 20px 15px;
        font-size: 1.1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .game-info {
        grid-template-columns: 1fr;
    }
    
    .match-table {
        font-size: 0.9rem;
    }
    
    .match-table th,
    .match-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}