* {
    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;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 25px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.main-content {
    display: flex;
    min-height: 600px;
    padding: 20px;
    gap: 20px;
}

.panel {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.panel h2 {
    color: #4f46e5;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #eef2ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.team-input h3 {
    color: #6366f1;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="text"] {
    padding: 15px;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.match-display {
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 25px;
}

.no-match {
    text-align: center;
    color: #64748b;
    padding: 40px 20px;
}

.score-display {
    text-align: center;
}

.team-score {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.team-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}

.players {
    color: #64748b;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.set-score {
    font-size: 3rem;
    font-weight: bold;
    color: #4f46e5;
}

.current-points {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eef2ff;
}

.point-score {
    font-size: 2rem;
    color: #10b981;
    font-weight: bold;
}

.score-controls {
    margin-top: 30px;
}

.point-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.point-btn {
    flex: 1;
    padding: 20px;
    font-size: 1.1rem;
}

.team1-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.team2-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.match-actions {
    display: flex;
    gap: 15px;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.match-item {
    background: #f8fafc;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #4f46e5;
    transition: transform 0.3s;
}

.match-item:hover {
    transform: translateX(5px);
    background: #f1f5f9;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.match-result {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 5px;
}

.match-date {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 10px;
}

.loading {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

footer {
    text-align: center;
    padding: 25px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .point-buttons {
        flex-direction: column;
    }
    
    .match-actions {
        flex-direction: column;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

.deuce-indicator {
    background: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
}

.advantage-indicator {
    background: #4caf50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
}

.tiebreak-badge {
    background: #f44336;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: bold;
}

.match-completed {
    background: #4caf50;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.score-box {
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    text-align: center;
}

.sets {
    font-size: 1.5em;
    font-weight: bold;
    color: #2196f3;
}

.games {
    font-size: 1.2em;
    margin: 5px 0;
    color: #673ab7;
}

.points {
    font-size: 2em;
    font-weight: bold;
    color: #f44336;
    margin-top: 10px;
}

.status-indicator {
    padding: 8px 15px;
    border-radius: 20px;
    margin: 10px 5px;
    font-weight: bold;
    text-align: center;
    display: inline-block;
    font-size: 0.9em;
}


.deuce {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

.advantage {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.team1 {
    border-left: 5px solid #2196F3;
}

.team2 {
    border-left: 5px solid #4CAF50;
}

.tiebreak {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    color: white;
    box-shadow: 0 3px 10px rgba(244, 67, 54, 0.3);
}

.completed {
    background: linear-gradient(135deg, #673AB7, #512DA8);
    color: white;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
    font-size: 1.2em;
    text-align: center;
    box-shadow: 0 5px 15px rgba(103, 58, 183, 0.3);
}

/* Point score highlighting */
.point-score .score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.point-score .score-value.advantage {
    color: #FF9800;
    animation: pulse 1.5s infinite;
    position: relative;
}

.point-score .score-value.advantage::after {
    content: 'AD';
    font-size: 0.8rem;
    position: absolute;
    top: -10px;
    right: -15px;
    background: #FF9800;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Tie-break info */
.tiebreak-info {
    background: linear-gradient(135deg, #FFF3E0, #FFECB3);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    border-left: 5px solid #FF9800;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.1);
}

.tiebreak-info p {
    margin: 5px 0;
    color: #E65100;
    font-weight: 600;
}

/* Match history items */
.match-item.active {
    border-left: 5px solid #2196F3;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.2);
}

.match-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 8px;
}

.match-status.completed {
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    color: #2E7D32;
}

.match-status.in-progress {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #EF6C00;
}

.winner {
    background: linear-gradient(135deg, #E1BEE7, #CE93D8);
    color: #7B1FA2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.match-details {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.current-set, .current-games {
    background: #F5F5F5;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #666;
}

/* Game score display */
.game-score {
    margin: 10px 0;
    padding: 10px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 8px;
    border-left: 3px solid #2196F3;
}

.game-score .score-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.game-score .score-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2196F3;
}

/* Point score display */
.point-score {
    margin: 15px 0;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.point-score .score-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.point-score .score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4CAF50;
    transition: all 0.3s ease;
}

/* Animations */
@keyframes pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Alert animations */
.alert-message {
    animation: fadeIn 0.3s ease;
}

.point-alert {
    animation: slideIn 0.3s ease;
}

/* Set display */
.score-display h3 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Teams container */
.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 30px;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    padding: 0 20px;
}

/* Team score boxes */
.team-score {
    flex: 1;
    padding: 20px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.team-score:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.team1-score {
    border-top: 5px solid #2196F3;
}

.team2-score {
    border-top: 5px solid #4CAF50;
}

.team-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.players {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.set-score {
    font-size: 2.5rem;
    font-weight: bold;
    color: #764ba2;
    margin: 10px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .teams-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .team-score {
        width: 100%;
    }
    
    .vs {
        padding: 10px 0;
        order: 1;
    }
    
    .point-score .score-value {
        font-size: 2rem;
    }
    
    .game-score .score-value {
        font-size: 1.5rem;
    }
}
