/* Free Fire Tournament Web App - Mobile First Design */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #FFD700;
    --accent-color: #00FF99;
    --dark-blue: #0A1628;
    --light-blue: #1E3A8A;
    --text-white: #FFFFFF;
    --text-gray: #B0BEC5;
    --card-bg: #1A2332;
    --border-color: #2D3748;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(255, 215, 0, 0.3);
}

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

html, body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--light-blue) 100%);
    color: var(--text-white);
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Mobile First - Base Styles */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--dark-blue);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px; /* Space for bottom navigation */
    overflow-y: auto;
}

/* Top Bar */
.top-bar {
    background: var(--card-bg);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
}

.welcome-text {
    font-size: 16px;
    font-weight: 500;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: var(--glow);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-balance {
    background: linear-gradient(45deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Image Slider */
.image-slider {
    position: relative;
    height: 200px;
    margin: 20px 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Section Headers */
.section-header {
    padding: 20px 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* My Matches Section */
.my-matches {
    padding: 0 15px 20px;
}

.match-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    flex: 1;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-white);
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.filter-btn.active {
    background: linear-gradient(45deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    border-color: var(--primary-color);
    box-shadow: var(--glow);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* Game Grid */
.games-section {
    padding: 0 15px 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--glow);
    transform: translateY(-5px);
}

.game-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin: 0 auto 15px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-logo img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 15px;
}

.game-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
}

/* Tournament Cards */
.tournament-card {
    background: var(--card-bg);
    border-radius: 15px;
    margin: 0 15px 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.tournament-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--glow);
}

.tournament-banner {
    height: 120px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    position: relative;
    overflow: hidden;
}

.tournament-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tournament-info {
    padding: 15px;
}

.tournament-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-white);
}

.tournament-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-item {
    text-align: center;
}

.detail-label {
    font-size: 11px;
    color: var(--text-gray);
    margin-bottom: 2px;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.join-btn {
    width: 100%;
    background: linear-gradient(45deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.join-btn:hover {
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

.join-btn:disabled {
    background: var(--border-color);
    color: var(--text-gray);
    cursor: not-allowed;
    transform: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    padding: 10px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-gray);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(255, 215, 0, 0.1);
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(255, 215, 0, 0.1);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Forms */
.form-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 25px;
    margin: 20px 15px;
    box-shadow: var(--shadow);
}

.form-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
}

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

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

.form-input {
    width: 100%;
    background: var(--dark-blue);
    border: 2px solid var(--border-color);
    color: var(--text-white);
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.form-btn {
    width: 100%;
    background: linear-gradient(45deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.form-btn:hover {
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 25px;
    margin: 20px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 24px;
    cursor: pointer;
}

/* Wallet Section */
.wallet-card {
    background: linear-gradient(135deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 15px;
    text-align: center;
    box-shadow: var(--shadow);
}

.wallet-balance-large {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.wallet-label {
    font-size: 14px;
    opacity: 0.8;
}

.wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 15px;
}

.wallet-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-white);
    padding: 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wallet-btn:hover {
    border-color: var(--primary-color);
    box-shadow: var(--glow);
}

/* Leaderboard */
.leaderboard-item {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 15px 20px;
    margin: 0 15px 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.rank-badge {
    background: linear-gradient(45deg, var(--primary-color), #FFA500);
    color: var(--dark-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.player-stats {
    font-size: 12px;
    color: var(--text-gray);
}

.player-points {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 768px) {
    .mobile-container {
        max-width: 768px;
    }
    
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tournament-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .mobile-container {
        max-width: 1024px;
    }
    
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.p-20 { padding: 20px; }
.hidden { display: none; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-10 { gap: 10px; }

/* Admin Panel Specific Styles */
.admin-sidebar {
    background: var(--card-bg);
    width: 250px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    box-shadow: var(--shadow);
    z-index: 100;
}

.admin-main {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

.admin-header {
    background: var(--card-bg);
    padding: 15px 30px;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--glow);
}

.data-table {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--dark-blue);
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    /* Compact Header for Mobile */
    .top-bar {
        padding: 8px 12px;
        min-height: 55px;
    }
    
    .welcome-text {
        font-size: 14px;
        font-weight: 600;
    }
    
    .top-bar-right {
        gap: 10px;
    }
    
    .notification-bell {
        padding: 6px;
        font-size: 14px;
    }
    
    .wallet-balance {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Header Images and Icons */
    .top-bar img, .header img {
        max-height: 35px;
        width: auto;
    }
    
    .top-bar .fas, .header .fas {
        font-size: 14px;
    }
    
    /* Section Headers Mobile */
    .section-header {
        padding: 15px 12px 8px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    /* Content Scrolling Fixes */
    .mobile-container {
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 90px; /* Extra space for bottom nav */
    }
    
    .my-matches, .games-section, .tournament-list {
        max-height: calc(100vh - 140px); /* Account for top bar + bottom nav */
        overflow-y: auto;
    }
    
    .tournament-card, .match-card {
        margin-bottom: 15px; /* Ensure proper spacing */
    }
    
    /* Ensure content is fully scrollable */
    .section-container {
        padding-bottom: 20px;
    }
    
    /* Modal and overlay fixes for mobile */
    .modal {
        overflow-y: auto;
        padding: 20px 10px;
    }
    
    .modal-content {
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        margin: 20px auto;
    }
    
    /* Tournament details scrolling */
    .tournament-details, .match-details {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        padding-bottom: 20px;
    }
    
    /* Admin Panel Mobile Styles */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
