/* ================= CSS STYLES ================= */
:root {
    --primary: #FF5500;
    --primary-dark: #d64000;
    --bg-color: #f8f9fa;
    --text-dark: #222;
    --text-light: #666;
    --white: #ffffff;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --input-bg: #fff;
    --sidebar-width: 280px;
}

body.dark-theme {
    --bg-color: #121212;
    --white: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-dark: #e0e0e0;
    --text-light: #a0a0a0;
    --border-color: #333;
    --input-bg: #2d2d2d;
}

body,
.match-card,
.game-card,
.panel,
.modal-content,
.auth-page,
.sidebar,
.sidebar-header,
.tab-btn {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Hind Siliguri', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    padding-bottom: 80px;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- HEADER --- */
header {
    background: var(--white);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo img {
    height: 45px;
    object-fit: contain;
}

.logo-text {
    font-weight: 800;
    font-size: 22px;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 16px;
    transition: 0.3s;
}

body.dark-theme .theme-btn {
    background: rgba(255, 255, 255, 0.1);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-login-nav {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 6px 15px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-reg-nav {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.user-nav {
    display: none;
    align-items: center;
    gap: 15px;
}

.balance-pill {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.icon-btn {
    font-size: 22px;
    color: #333;
    cursor: pointer;
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    display: none;
}

/* --- AUTH PAGES (FULL SCREEN) --- */
.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-page.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.auth-sub {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* --- SIDEBAR MENU --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: var(--sidebar-width);
    height: 100%;
    background: white;
    z-index: 999;
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.notif-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: var(--sidebar-width);
    height: 100%;
    background: white;
    z-index: 999;
    transition: right 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.notif-sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #fff;
    position: relative;
}

.sidebar-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.sidebar-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #eee;
    object-fit: cover;
    border: 3px solid var(--primary);
    padding: 2px;
}

.user-info {
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu li {
    padding: 14px 25px;
    cursor: pointer;
    font-size: 15px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.sidebar-menu li:hover {
    background: #fff5f5;
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu li i {
    width: 25px;
    text-align: center;
    font-size: 18px;
    color: #888;
}

.sidebar-menu li:hover i {
    color: var(--primary);
}

.notif-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.notif-icon {
    width: 35px;
    height: 35px;
    background: #fff0f0;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content h5 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
}

.notif-content p {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

/* --- MAIN SECTIONS --- */
.app-section {
    padding: 15px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HERO & SLIDER */
.hero-banner {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.alert-box {
    background: #222;
    color: white;
    padding: 8px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-container {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.section-title {
    font-weight: 800;
    font-size: 18px;
    margin: 15px 0;
    color: var(--text-dark);
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

/* --- GRID SYSTEM --- */
.category-list,
#matches-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 768px) {

    .category-list,
    #matches-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1200px) {
    #matches-container {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .category-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.game-card {
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: transform 0.2s;
    background-color: #000;
}

.game-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    z-index: 1;
    transition: opacity 0.3s;
}

.game-card:hover .game-card-bg {
    opacity: 0.4;
}

.game-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.game-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    background: #fff;
}

.game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-title {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.match-count {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.match-count::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
}

/* --- MATCH VIEW --- */
.how-to-join-btn {
    background: #f1f1f1;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.tab-container {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    background: var(--card-bg);
    color: var(--text-light);
}

.tab-btn.active {
    background: #fff0f0;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.match-card {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.m-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.m-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.m-title-box {
    flex: 1;
}

.m-title {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.m-time {
    font-size: 10px;
    color: var(--primary);
    font-weight: 600;
}

.m-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 15px;
    text-align: center;
}

.m-stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 9px;
    color: #777;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 11px;
    font-weight: 800;
    color: #000;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
}

.m-status-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.btn-join-outline {
    border: 1px solid var(--primary);
    color: white;
    background: var(--primary);
    padding: 8px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    width: 48%;
    text-align: center;
}

.btn-join-outline:hover {
    opacity: 0.9;
}

.btn-view-participants {
    border: 1px solid #333;
    color: #333;
    background: transparent;
    padding: 8px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    width: 48%;
    text-align: center;
}

.btn-view-participants:hover {
    background: #eee;
}

.btn-view-result {
    border: 1px solid #ccc;
    color: #333;
    background: #f9f9f9;
    padding: 4px 20px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
    transition: 0.2s;
}

.btn-view-result:hover {
    background: #eee;
}

.btn-full-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: #fff;
    cursor: not-allowed;
    padding: 4px 20px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
}

.m-btn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-prize {
    background: #333;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-room {
    background: linear-gradient(45deg, #FF5500, #ff8800);
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.timer-display {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #d64000;
    padding-top: 5px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
    background: #fff5f5;
    border-radius: 4px;
    padding: 5px;
}

/* RESULT VIEW PAGE */
.result-view-header {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.result-view-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 15px;
}

.result-table th {
    background: #f8f9fa;
    text-align: left;
    padding: 10px;
    font-weight: 700;
    color: #444;
    border-bottom: 2px solid #eee;
}

.result-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.winner-row {
    background: #f0fff4;
}

/* GENERAL UI ELEMENTS */
.card-panel {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.card-panel h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-dark);
}

.input-field:focus {
    border-color: var(--primary);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.1);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    width: 100%;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(255, 85, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CANCEL BUTTON STYLE */
.btn-cancel {
    background: #f1f1f1;
    color: #555;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 8px;
    width: 100%;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    text-align: center;
    display: block;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-cancel:hover {
    background: #e9e9e9;
    border-color: #ccc;
}

/* GOOGLE BTN STYLE */
.google-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
}

.google-btn:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    padding: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal-box {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

/* PAYMENT & RULES */
.payment-details-box {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

/* Bkash Theme */
.theme-bkash-bg {
    background: #e2136e;
    color: white;
    padding: 30px 20px;
    text-align: center;
}

/* Nagad Theme */
.theme-nagad-bg {
    background: #ec1c24;
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.rules-box {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.rules-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #000;
}

.rules-list {
    list-style: none;
    font-size: 12px;
    color: #444;
    line-height: 1.8;
}

.rules-list li {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.rules-list li i {
    color: #d64000;
    margin-top: 4px;
    font-size: 10px;
}

.step-container {
    display: none;
    animation: slideInRight 0.3s ease;
}

.step-container.active-step {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.method-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 15px;
    background: #fff;
    transition: 0.2s;
}

.method-btn:hover {
    border-color: var(--primary);
    background: #fff5f5;
}

.method-btn img {
    height: 35px;
    object-fit: contain;
}

.back-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Joined Members Table */
.joined-list {
    list-style: none;
    padding: 0;
}

.joined-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #eee;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 5px;
}

.joined-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.joined-uid {
    font-size: 12px;
    color: #777;
}