/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

body.dark-theme {
    background-color: #1a1a1a;
    color: #fff;
}

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

/* Header styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

header.dark-theme {
    background-color: #2d2d2d;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: #e9ecef;
}

nav a.dark-theme {
    color: #fff;
}

nav a.dark-theme:hover {
    background-color: #444;
}

/* Main content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

section.dark-theme {
    background-color: #333;
    color: #fff;
}

h2 {
    margin-bottom: 1rem;
    color: #495057;
}

h2.dark-theme {
    color: #fff;
}

p {
    margin-bottom: 1rem;
}

/* Demo box */
.demo-box {
    background-color: #e9f7fe;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
    transition: all 0.3s ease;
}

.demo-box.dark-theme {
    background-color: #2c3e50;
    color: #fff;
}

/* Button styles */
#toggleBtn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#toggleBtn:hover {
    background-color: #0056b3;
}

#toggleBtn.dark-theme {
    background-color: #6c757d;
}

#toggleBtn.dark-theme:hover {
    background-color: #545b62;
}

/* Footer styles */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

footer.dark-theme {
    background-color: #2d2d2d;
    border-top: 1px solid #444;
    color: #fff;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    section {
        padding: 1rem;
    }
    
    main {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .demo-box {
        padding: 1rem;
    }
    
    #toggleBtn {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Animation for demo */
/* Game-specific styles */
.game-preview {
    text-align: center;
    margin: 2rem 0;
}

.card-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.player-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.player-info {
    font-weight: bold;
    padding: 0.5rem 1rem;
    background-color: #e9ecef;
    border-radius: 4px;
}

body.dark-theme .player-info {
    background-color: #404040;
}

.hand-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    width: 50px;
    height: 70px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card.red {
    color: #dc3545;
}

body.dark-theme .card {
    background-color: #3d3d3d;
    border-color: #555;
    color: white;
}

.center-area {
    text-align: center;
}

.game-info {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #e9ecef;
    border-radius: 4px;
}

body.dark-theme .game-info {
    background-color: #404040;
}

.played-cards {
    min-height: 80px;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    margin: 0.5rem;
}

button:hover {
    background-color: #0056b3;
}

/* Game room styles */
.game-room {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.players-list, .game-controls {
    flex: 1;
    min-width: 300px;
}

.players-list ul {
    list-style: none;
}

.player-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: #e9ecef;
    border-radius: 4px;
}

body.dark-theme .player-item {
    background-color: #404040;
}

.status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status.online {
    background-color: #28a745;
    color: white;
}

.status.offline {
    background-color: #6c757d;
    color: white;
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Lobby styles */
.lobby-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.create-room, .room-list {
    flex: 1;
    min-width: 300px;
}

#create-room-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#create-room-form input,
#create-room-form select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

body.dark-theme #create-room-form input,
body.dark-theme #create-room-form select {
    background-color: #3d3d3d;
    border-color: #555;
    color: white;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background-color: #e9ecef;
    border-radius: 4px;
}

body.dark-theme .room-item {
    background-color: #404040;
}

.join-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.join-btn:hover {
    background-color: #218838;
}

/* Rules content */
.rules-content h3 {
    margin-bottom: 0.5rem;
}

.rules-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

/* Footer game status */
.game-status {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    section {
        padding: 1rem;
    }
    
    main {
        padding: 1rem 0;
    }
    
    .card-table {
        gap: 1rem;
    }
    
    .player-seat {
        gap: 0.5rem;
    }
    
    .hand-cards {
        gap: 0.25rem;
    }
    
    .card {
        width: 40px;
        height: 60px;
        font-size: 0.7rem;
    }
    
    .game-room {
        flex-direction: column;
    }
    
    .lobby-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .demo-box {
        padding: 1rem;
    }
    
    #toggleBtn {
        width: 100%;
        padding: 0.75rem;
    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.6s ease-out;
}