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

:root {
    --primary-color: #2C3E50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-bg: #1a1a1a;
    --light-bg: #ecf0f1;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dfe6e9;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

/* Auth Modal */
.auth-modal {
    max-width: 450px;
}

.auth-container {
    text-align: center;
}

.auth-header {
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group label i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.auth-switch {
    margin-top: 20px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.5em;
    font-weight: bold;
}

.nav-brand i {
    font-size: 1.2em;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--secondary-color);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-balance {
    background-color: var(--success-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
}

.content-section {
    display: none;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in;
}

.content-section.active {
    display: block;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header .btn {
    width: auto;
}

/* Games List */
.games-grid {
    display: grid;
    gap: 20px;
}

.game-card {
    background-color: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.game-info {
    flex: 1;
}

.game-info h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.game-details {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.game-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-stake {
    background-color: var(--success-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
}

.no-games {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 1.1em;
}

/* Tournaments */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.tournament-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

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

.tournament-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.tournament-info {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tournament-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
}

.tournament-card .btn {
    margin-top: 15px;
}

/* Wallet */
.wallet-container {
    max-width: 900px;
    margin: 0 auto;
}

.wallet-header {
    text-align: center;
    margin-bottom: 40px;
}

.wallet-header h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.wallet-balance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
}

.balance-label {
    display: block;
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.balance-amount {
    display: block;
    font-size: 3em;
    font-weight: bold;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.wallet-card {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.wallet-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.wallet-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.transaction-history {
    margin-top: 40px;
}

.transaction-history h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.transaction-item {
    background-color: var(--light-bg);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--secondary-color);
}

.transaction-item.deposit {
    border-left-color: var(--success-color);
}

.transaction-item.withdrawal {
    border-left-color: var(--danger-color);
}

.transaction-details {
    flex: 1;
}

.transaction-type {
    font-weight: bold;
    color: var(--primary-color);
    text-transform: capitalize;
}

.transaction-date {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.transaction-amount {
    font-size: 1.2em;
    font-weight: bold;
}

.transaction-amount.positive {
    color: var(--success-color);
}

.transaction-amount.negative {
    color: var(--danger-color);
}

.transaction-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.transaction-status.pending {
    background-color: var(--warning-color);
    color: white;
}

.transaction-status.approved,
.transaction-status.completed {
    background-color: var(--success-color);
    color: white;
}

.transaction-status.rejected {
    background-color: var(--danger-color);
    color: white;
}

/* Profile */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
}

.profile-avatar {
    font-size: 5em;
    margin-bottom: 20px;
}

.profile-info h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--light-bg);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.stat-card i {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Payment Instructions */
.payment-instructions {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-number {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .section-header .btn {
        width: 100%;
    }
    
    .tournaments-grid {
        grid-template-columns: 1fr;
    }
    
    .wallet-actions {
        grid-template-columns: 1fr;
    }
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
