* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Screen */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #2c3e50;
}

.login-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-box button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.login-box button:hover {
    background-color: #2980b9;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
}

/* Main Container */
#main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-item:hover {
    background-color: #34495e;
}

.nav-item.active {
    background-color: #3498db;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section {
    display: none;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section.active {
    display: block;
}

h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

h3 {
    margin: 1.5rem 0 1rem;
    color: #2c3e50;
}

/* Form Inputs */
.input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="date"],
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Player List */
.player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.player-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.player-ranking {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.player-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-button {
    background-color: #ecf0f1;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
    text-align: center;
}

.toggle-button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.toggle-button.win {
    background-color: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.toggle-button.lose {
    background-color: #e74c3c;
    color: white;
    border-color: #c0392b;
}

.win {
    background-color: #2ecc71;
    border-color: #2ecc71;
}

.lose {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

/* Buttons */
.button-container {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.primary-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.primary-button:hover {
    background-color: #2980b9;
}

.primary-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Validation Result */
.validation-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.validation-success {
    border-left: 5px solid #2ecc71;
}

.validation-error {
    border-left: 5px solid #e74c3c;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Leaderboard Styles */
.leaderboard-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.leaderboard-header h2 {
    margin: 0;
    color: #333;
}

.latest-update {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.save-button:hover {
    background-color: #45a049;
}

.table-container {
    overflow-x: auto;
}

/* Water line row styling */
.water-line-row {
    background: linear-gradient(90deg, #e6f3ff 0%, #b3d9ff 50%, #e6f3ff 100%);
    position: relative;
    overflow: hidden;
    height: 40px;
}

.water-line-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: water-flow 2s linear infinite;
}

@keyframes water-flow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Player background colors */
.player-positive {
    background-color: rgba(255, 215, 0, 0.1); /* Light gold for lowest positive */
}

.player-positive-1 {
    background-color: rgba(255, 215, 0, 0.2);
}

.player-positive-2 {
    background-color: rgba(255, 215, 0, 0.3);
}

.player-positive-3 {
    background-color: rgba(255, 215, 0, 0.4);
}

.player-positive-max {
    background-color: rgba(255, 215, 0, 0.5); /* Darker gold for highest positive */
}

.player-negative {
    background-color: rgba(144, 238, 144, 0.1); /* Light green for lowest negative */
}

.player-negative-1 {
    background-color: rgba(144, 238, 144, 0.2);
}

.player-negative-2 {
    background-color: rgba(144, 238, 144, 0.3);
}

.player-negative-3 {
    background-color: rgba(144, 238, 144, 0.4);
}

.player-negative-max {
    background-color: rgba(144, 238, 144, 0.5); /* Darker green for highest negative */
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }
    
    .nav-brand {
        margin-bottom: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
    
    .nav-item {
        margin: 0 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .player-list {
        grid-template-columns: 1fr;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .leaderboard-container {
        padding: 10px;
    }
    
    .save-button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

.save-button-container {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
}

/* Player name cell styling */
.player-name-cell {
    font-weight: 700;
    font-size: 1em;
    color: #333;
}

/* Ranking cell styling */
.ranking-cell {
    font-weight: 700;
    font-size: 1em;
    color: #333;
}

/* History Records Styles */
.history-result {
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.history-result h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
}

#history-table th,
#history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#history-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.win-status {
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
}

.win-status.win {
    background-color: rgba(255, 215, 0, 0.3);  /* 金色背景，更明显 */
    color: #8B4513;  /* 深棕色文字，与金色背景搭配 */
}

.win-status.lose {
    background-color: rgba(144, 238, 144, 0.3);  /* 淡绿色背景，更明显 */
    color: #006400;  /* 深绿色文字，与淡绿色背景搭配 */
}

#no-records-message {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* Add Player Styles */
.add-player-container {
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.add-player-input {
    display: flex;
    gap: 10px;
}

.add-player-input input {
    flex: 1;
}

.add-player-input button {
    white-space: nowrap;
    padding-left: 15px;
    padding-right: 15px;
}

#update-leaderboard-button {
    margin-top: 15px;
    background-color: #27ae60;
    font-weight: bold;
}

#update-leaderboard-button:hover {
    background-color: #2ecc71;
}

#update-leaderboard-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Add styling for save history button container */
#save-history-btn-container {
    margin-top: 20px;
    text-align: center;
}

#save-history-btn-container.hidden {
    display: none;
} 