body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
}

.main-header {
    text-align: center;
    padding: 40px 20px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2px;
}

h1 { 
    margin-bottom: 20px; 
    color: #1a73e8; 
}

.nav-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

#add-game-button, #view-button {
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
}

#add-game-button {
    background-color: #1a73e8;
}

#add-game-button:hover {
    background-color: #1557b0;
    transform: translateY(-1px);
}

#view-button {
    background-color: #34a853;
}

#view-button:hover {
    background-color: #2d8a46;
    transform: translateY(-1px);
}

.tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 20px;
    padding: 20px;
    width: 100%;
    align-items: start;
    box-sizing: border-box;
}

.genre-card {
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
    overflow-x: auto;
}

.genre-card h3 {
    text-align: center;
    text-transform: uppercase;
    font-size: 1.1em;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 10px;
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 15px; /* Increased spacing for a cleaner look */
    text-align: left;
    border-bottom: 1px solid #eee;
}

td button {
    padding: 6px 12px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

td button:nth-of-type(1) {
    background-color: #e8f0fe;
    color: #1a73e8;
}

td button:nth-of-type(1):hover {
    background-color: #d2e3fc;
}

td button:nth-of-type(2) {
    background-color: #fce8e6;
    color: #d93025;
}

td button:nth-of-type(2):hover {
    background-color: #fad2cf;
}

#modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(32, 33, 36, 0.6); 
    backdrop-filter: blur(4px);
    display: none; 
    align-items: center; 
    justify-content: center;
    z-index: 1000;
}

#modal-overlay:not(.hidden) {
    display: flex;
}

.hidden { 
    display: none !important; 
}

.modal { 
    background: white; 
    padding: 32px; 
    border-radius: 12px; 
    width: 100%;
    max-width: 400px; 
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#game-form label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #5f6368;
}

#game-form input, #game-form select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

#game-form input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.modal-buttons button[type="submit"] {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

#cancel-button {
    background-color: transparent;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

#stats-view {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.stats-container h2 {
    text-align: center;
    color: #202124;
    margin-bottom: 30px;
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    min-width: 250px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
}

.stat-card.blue .stat-value { color: #1a73e8; }
.stat-card.gold .stat-value { color: #f9ab00; }
.stat-card.purple .stat-value { color: #9334e6; }

.stat-value::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    margin: 15px auto;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.3;
}

main, #list-view, #stats-view {
    min-height: 80vh;
}

/* style.css */
#pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#pagination-controls button {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

#pagination-controls button:disabled {
    background-color: #dadce0;
    cursor: not-allowed;
}

#page-indicator {
    font-weight: 600;
    color: #5f6368;
}

@media screen and (max-width: 768px) {
    .main-header h1 {
        font-size: 1.3rem;
    }

    .nav-controls {
        flex-direction: column;
        padding: 0 20px;
    }

    #add-game-button, #view-button {
        width: 100%;
    }

    .genre-card {
        width: 95%;
        overflow-x: auto; /* Allows table scrolling on small screens */
        padding: 10px;
    }

    .stats-grid {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        max-width: 280px;
    }
}