/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --success: #4cc9f0;
    --danger: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
}

body {
    background: #f5f5f5;
    color: var(--dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--gray);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--secondary);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Header */
.mobile-header {
    background: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wallet-balance {
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.logout-btn {
    color: var(--danger);
    font-size: 20px;
    text-decoration: none;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s;
    z-index: 1000;
}

.side-menu.active {
    left: 0;
}

.menu-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.menu-list {
    list-style: none;
    padding: 20px 0;
}

.menu-list li {
    margin-bottom: 5px;
}

.menu-list a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.3s;
}

.menu-list a:hover {
    background: #f0f0f0;
}

.menu-list .active a {
    background: var(--primary);
    color: white;
}

.menu-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: var(--gray);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    margin-top: 70px;
}

.page-header {
    margin-bottom: 30px;
}

/* Cards */
.balance-card, .game-card, .form-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.stat-card i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.quick-link {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.quick-link:hover {
    transform: translateY(-5px);
}

.quick-link i {
    font-size: 30px;
    color: var(--primary);
}

/* Transactions & History */
.transactions, .game-history, .history-list {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
}

.transaction-item, .game-item, .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.transaction-item:last-child, .game-item:last-child, .history-item:last-child {
    border-bottom: none;
}

.credit {
    color: #28a745;
}

.debit {
    color: #dc3545;
}

.empty {
    text-align: center;
    padding: 30px;
    color: var(--gray);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group small {
    color: var(--gray);
    font-size: 12px;
}

.btn-game {
    background: linear-gradient(135deg, var(--primary), var(--success));
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 18px;
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

/* Game Rules */
.game-rules {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.game-rules ul {
    padding-left: 20px;
    margin-top: 10px;
}

.game-rules li {
    margin-bottom: 5px;
}

/* History Items */
.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-icon {
    font-size: 24px;
    color: var(--primary);
}

.history-details {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .auth-container {
        margin: 10px;
        padding: 20px;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
    }
}