/* Global Styles */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --accent-color: #FF6B6B;
    --bg-color: #F5F7FA;
    --text-color: #2C3E50;
    --card-bg: #FFFFFF;
    --border-color: #E1E8ED;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

.dark-theme {
    --bg-color: #1a1a2e;
    --text-color: #eee;
    --card-bg: #16213e;
    --border-color: #0f3460;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo i {
    font-size: 2rem;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-buttons {
    display: flex;
    gap: 0.5rem;
}

#user-info {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #40b868;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-logout {
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #e55555;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--primary-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.game-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.game-card p {
    text-align: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

.game-stats {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.game-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 3rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: var(--secondary-color);
    color: white;
}

.notification-error {
    background: var(--accent-color);
    color: white;
}

.notification-info {
    background: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background: var(--card-bg);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

footer p {
    opacity: 0.7;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
