/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    margin-bottom: 30px;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.hidden {
    display: none !important;
}

/* User Grid */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    justify-items: center;
}

.user-btn {
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 150px;
}

.user-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.user-btn:active {
    transform: translateY(0);
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: scale(1.05);
}

/* Form Styles */
.form-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1rem;
}

#guesses {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    transition: border-color 0.3s ease;
}

#guesses:focus {
    outline: none;
    border-color: #667eea;
}

.submit-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #2196F3 0%, #0D47A1 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: scale(1.05);
}

/* Summary Section */
.summary-card {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.summary-card p {
    margin: 0;
}

/* Tally Section */
.tally-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.tally-card {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.tally-card h4 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.tally-card .score {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
}

/* Rankings Section */
.rankings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.ranking-item {
    background: linear-gradient(135deg, #3F51B5 0%, #212121 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ranking-item .rank {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.ranking-item .name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.ranking-item .total-score {
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .section {
        padding: 20px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .user-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .tally-container, .rankings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .user-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary-card, .tally-card, .ranking-item {
        padding: 15px;
    }
}

/* Navigation Styles */
.navigation {
    margin-top: 20px;
    padding: 10px;
    background-color: #333;
    border-radius: 5px;
}

.navigation ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 10px;
}

.navigation li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navigation li a:hover,
.navigation li a.active {
    background-color: #007bff;
}

/* Historical View Styles */
.historical-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.historical-controls label {
    font-weight: bold;
}

.historical-controls select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.historical-controls button {
    padding: 8px 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.historical-controls button:hover {
    background-color: #218838;
}

.historical-results {
    margin-top: 20px;
}

/* Admin Styles */
.admin-submenu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-submenu a {
    padding: 10px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-submenu a:hover,
.admin-submenu a.active {
    background-color: #007bff;
}

.admin-section {
    margin-top: 20px;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.data-table input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.data-table button {
    padding: 5px 10px;
    margin: 0 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.data-table button:first-of-type {
    background-color: #ffc107;
    color: #212529;
}

.data-table button:last-of-type {
    background-color: #dc3545;
    color: white;
}

.data-table button:hover {
    opacity: 0.9;
}
