* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2.2em;
}

.section {
    background: white;
    margin: 15px 0;
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h2 {
    color: #34495e;
    margin-bottom: 12px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 4px;
    font-size: 1.3em;
}

.form-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

input, select, button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input, select {
    flex: 1;
    min-width: 150px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

button:hover {
    background-color: #2980b9;
}

.team-card {
    background: #ecf0f1;
    padding: 12px;
    margin: 6px 0;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.team-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
}

.team-stats {
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.match-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4px;
}

.match-item {
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 3px;
    border-left: 2px solid #27ae60;
    font-size: 0.8em;
}

.match-teams {
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 0.85em;
}

.match-winner {
    color: #27ae60;
    font-size: 0.75em;
    margin-bottom: 1px;
}

.match-date {
    font-size: 0.7em;
    color: #7f8c8d;
    margin-top: 2px;
}

.match-info {
    background: #e8f4fd;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    font-size: 0.9em;
    color: #2c3e50;
}

.team-group {
    margin-bottom: 8px;
}

.team-group-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
    padding: 3px 6px;
    background: #ecf0f1;
    border-radius: 2px;
    font-size: 0.85em;
}

.team-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 3px;
}

.eligible-pair {
    background: #e8f5e8;
    padding: 4px 6px;
    border-radius: 2px;
    border-left: 2px solid #27ae60;
    font-size: 0.82em;
}

.ineligible-pair {
    background: #ffeaea;
    padding: 4px 6px;
    border-radius: 2px;
    border-left: 2px solid #e74c3c;
    font-size: 0.82em;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-pair-name {
    font-weight: bold;
    margin-bottom: 1px;
    font-size: 0.9em;
}

.match-pair-status {
    font-size: 0.78em;
    margin-bottom: 0;
}

.status {
    font-size: 0.85em;
    margin-top: 5px;
    font-style: italic;
}

.eligible {
    color: #27ae60;
}

.ineligible {
    color: #e74c3c;
}

/* Clickable Match Buttons */
.eligible-match-button {
    display: flex;
    background: #e8f5e8;
    border-radius: 4px;
    border: 2px solid #27ae60;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.82em;
    min-height: 40px;
}

.eligible-match-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.match-button-left,
.match-button-right {
    flex: 1;
    padding: 4px 6px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-button-left:hover,
.match-button-right:hover {
    background: #27ae60;
    color: white;
}



.match-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    background: #27ae60;
    color: white;
    font-weight: bold;
    font-size: 0.65em;
    min-width: 24px;
}

.match-button-left .team-name,
.match-button-right .team-name {
    font-weight: bold;
    font-size: 0.85em;
}/*
 Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .section {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode h2 {
    color: #ffffff;
    border-bottom-color: #4a9eff;
}

body.dark-mode input, 
body.dark-mode select, 
body.dark-mode button {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode button {
    background-color: #4a9eff;
}

body.dark-mode button:hover {
    background-color: #357abd;
}

body.dark-mode .team-card {
    background: #3a3a3a;
    border-left-color: #4a9eff;
}

body.dark-mode .team-name {
    color: #ffffff;
}

body.dark-mode .team-stats {
    color: #b0b0b0;
}

body.dark-mode .match-item {
    background: #3a3a3a;
    border-left-color: #4caf50;
}

body.dark-mode .match-teams {
    color: #ffffff;
}

body.dark-mode .match-winner {
    color: #4caf50;
}

body.dark-mode .match-date {
    color: #b0b0b0;
}

body.dark-mode .team-group-header {
    background: #3a3a3a;
    color: #ffffff;
}

body.dark-mode .eligible-pair {
    background: #1e3a1e;
    border-left-color: #4caf50;
}

body.dark-mode .ineligible-pair {
    background: #3a1e1e;
    border-left-color: #f44336;
}

body.dark-mode .match-pair-name {
    color: #ffffff;
}

body.dark-mode .eligible {
    color: #4caf50;
}

body.dark-mode .ineligible {
    color: #f44336;
}

body.dark-mode .match-info {
    background: #2a3a4a;
    border-left-color: #4a9eff;
    color: #e0e0e0;
}

/* Dark Mode Match Buttons */
body.dark-mode .eligible-match-button {
    background: #1e3a1e;
    border-color: #4caf50;
}

body.dark-mode .eligible-match-button:hover {
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

body.dark-mode .match-button-left,
body.dark-mode .match-button-right {
    color: #e0e0e0;
}

body.dark-mode .match-button-left:hover,
body.dark-mode .match-button-right:hover {
    background: #4caf50;
    color: white;
}

body.dark-mode .match-vs {
    background: #4caf50;
}

/* Saved Fights Interface */
.saved-fights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.saved-fight-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fight-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fight-details {
    font-size: 0.8em;
    color: #6c757d;
}

.fight-date {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9em;
}

.fight-actions {
    display: flex;
    gap: 6px;
}

.load-fight-btn {
    background-color: #28a745;
    padding: 6px 12px;
    font-size: 0.8em;
    min-width: 60px;
}

.load-fight-btn:hover {
    background-color: #218838;
}

.download-fight-btn {
    background-color: #17a2b8;
    padding: 6px 12px;
    font-size: 0.8em;
    min-width: 80px;
}

.download-fight-btn:hover {
    background-color: #138496;
}

/* Dark Mode Server Fights */
body.dark-mode .server-fight-item {
    background: #3a3a3a;
    border-left-color: #4caf50;
}

body.dark-mode .fight-date {
    color: #ffffff;
}

body.dark-mode .load-fight-btn {
    background-color: #4caf50;
}

body.dark-mode .load-fight-btn:hover {
    background-color: #45a049;
}

body.dark-mode .download-fight-btn {
    background-color: #2196f3;
}

body.dark-mode .download-fight-btn:hover {
    background-color: #1976d2;
}

.delete-fight-btn {
    background-color: #dc3545;
    padding: 6px 12px;
    font-size: 0.8em;
    min-width: 60px;
}

.delete-fight-btn:hover {
    background-color: #c82333;
}

/* Update dark mode for saved fights */
body.dark-mode .saved-fight-item {
    background: #3a3a3a;
    border-left-color: #4caf50;
}

body.dark-mode .fight-details {
    color: #b0b0b0;
}

body.dark-mode .delete-fight-btn {
    background-color: #dc3545;
}

body.dark-mode .delete-fight-btn:hover {
    background-color: #c82333;
}