/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 20px;
    transition: all 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.coins {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.game-card h3 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.game-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Bottom Menu */
.bottom-menu {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.menu-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.menu-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.menu-btn i {
    font-size: 1.2rem;
}

.menu-btn span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Game Screen */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Game Area */
.game-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.control-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 12px 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Profile Screen */
.profile-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #667eea;
}

.profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.profile-info h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.profile-info p {
    color: #666;
    margin-bottom: 5px;
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 20px;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.bet-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bet-option {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.bet-option:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.custom-bet {
    display: flex;
    gap: 10px;
}

.custom-bet input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
}

.custom-bet input:focus {
    outline: none;
    border-color: #667eea;
}

.custom-bet button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-bet button:hover {
    background: #5a6fd8;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification.hidden {
    opacity: 0;
    transform: translateX(100%);
}

.notification.error {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.notification.warning {
    background: linear-gradient(45deg, #ff9800, #f57c00);
}

/* Card Styles */
.card {
    width: 60px;
    height: 90px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #333;
}

.card-suit {
    font-size: 1.2rem;
}

.card-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Game Specific Styles */
.poker-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.player-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.community-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.blackjack-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dealer-area, .player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hand {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.hand-value {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .game-icon {
        font-size: 2.5rem;
    }
    
    .card {
        width: 50px;
        height: 75px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.5s ease;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .header, .game-header, .profile-header, .profile-content, .game-area {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .game-card {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }
    
    .bottom-menu {
        background: rgba(44, 62, 80, 0.95);
    }
    
    .modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
}
