/* Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.dark-theme {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 100%);
    min-height: 100vh;
}

/* Typography */
.glow-text {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-glow {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-glow:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--dark-card), #1e293b) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--dark-border);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.min-vh-80 {
    min-height: 80vh;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.animate-typing {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(20, end), blink-caret 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    margin-top: 2rem;
}

/* Floating Cards Animation */
.hero-cards {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    width: 120px;
    height: 160px;
    background: linear-gradient(135deg, var(--dark-card), #2d3748);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--dark-border);
}

.card-1 {
    top: 20%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.card-2 {
    top: 10%;
    right: 20%;
    animation: float 6s ease-in-out infinite 1s;
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-3 {
    bottom: 20%;
    left: 20%;
    animation: float 6s ease-in-out infinite 2s;
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-4 {
    bottom: 10%;
    right: 10%;
    animation: float 6s ease-in-out infinite 3s;
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Feature Cards */
.features-section {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
}

.feature-card {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid var(--dark-border);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
}

.auth-card {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--dark-border);
    position: relative;
    z-index: 2;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--dark-border);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.input-group-text {
    background: var(--dark-border);
    border: 1px solid var(--dark-border);
    color: var(--text-secondary);
}

.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dark-border);
}

/* Background Animation */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), transparent);
    animation: float-shapes 20s infinite linear;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-duration: 25s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-duration: 30s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-duration: 20s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 30%;
    animation-duration: 35s;
}

@keyframes float-shapes {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, 50px) rotate(120deg); }
    66% { transform: translate(-20px, 80px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Game Page Styles */
.game-page {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1e293b 100%);
}

.game-header-card {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--dark-border);
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.welcome-text {
    font-weight: 600;
    color: var(--text-primary) !important;
}

/* Game Room Cards */
.game-room-card {
    background: var(--dark-card);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--dark-border);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.game-room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.game-room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.game-room-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.game-room-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0;
    flex: 1;
}

.game-room-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.game-room-info {
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.info-item i {
    margin-left: 0.5rem;
    width: 20px;
    text-align: center;
}

.game-room-progress {
    margin-bottom: 1.5rem;
}

.progress {
    background: var(--dark-border);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.game-room-actions {
    text-align: left;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--dark-card);
    border-radius: 20px;
    border: 2px dashed var(--dark-border);
}

/* Modals */
.dark-modal {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 20px;
    color: var(--text-primary);
}

.dark-modal .modal-header {
    border-bottom: 1px solid var(--dark-border);
}

.dark-modal .modal-footer {
    border-top: 1px solid var(--dark-border);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Payment Modal Styles */
.payment-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.payment-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.payment-methods {
    text-align: right;
    margin-bottom: 2rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-primary);
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .game-room-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .game-room-badge {
        margin-top: 0.5rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}