/* style.css - Main stylesheet */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b0f1a;
    --card: #161d2f;
    --accent: #0ea5e9;
    --text: #ffffff;
    --gray: #94a3b8;
    --green: #22c55e;
    --accent-dark: #0369a1;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Header */
.header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1f2937;
    background: #0f1420;
    animation: fadeIn 0.5s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.auth-btn {
    background: var(--accent);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
    border-radius: 30px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

/* Sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100%;
    background: var(--bg);
    border-right: 1px solid #1f2937;
    z-index: 10001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
}

.sidebar-menu-item {
    background: #1a202c;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid #2a3346;
    transition: 0.3s;
}

.sidebar-menu-item:hover {
    border-color: #f97316;
    background: #1e2532;
    transform: translateY(-2px);
}

.sidebar-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    background: #f97316;
}

.sidebar-menu-text {
    flex: 1;
    font-weight: bold;
    font-size: 15px;
    color: white;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, #1c2437, #161d2f);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #3f4e6b;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14,165,233,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Banner */
.banner {
    width: 100%;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #1f2937;
    margin: 10px 0 15px;
    background: #161d2f;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.5s ease-out backwards;
}

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

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeIn 0.8s ease;
    text-decoration: none;
}

.slide.active {
    display: block;
}

/* Category Cards */
#dynamic-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #2a3346;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeUp 0.6s ease-out backwards;
    margin-bottom: 0;
}

.cat-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.cat-card:active {
    background: #1f2a41;
    transform: scale(0.98);
}

.cat-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: transform 0.3s ease;
    border-radius: 0;
}

.cat-card:hover .cat-img {
    transform: scale(1.05);
}

.cat-title {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    background: #1c2437;
    border-top: 1px solid #2a3346;
}

/* Match Cards */
.match-card {
    background: #1c2437;
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 25px;
    border: 1px solid #2d3748;
    position: relative;
    box-shadow: 0 8px 0 #0f131e;
    transition: all 0.3s ease;
    animation: fadeUp 0.6s ease-out backwards;
}

.match-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.4), 0 8px 0 #0f131e;
    border-color: var(--accent);
}

.match-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(14,165,233,0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.match-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 2px solid #fff;
    background: #0b0f1a;
    padding: 3px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.match-card:hover .match-logo {
    transform: scale(1.1) rotate(5deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    margin-bottom: 20px;
    background: #1e283d;
    border-radius: 20px;
    padding: 12px 0;
    transition: 0.3s ease;
}

.match-card:hover .stats-grid {
    background: #25314a;
}

.stat-item span {
    display: block;
    font-size: 10px;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-item b {
    font-size: 18px;
    font-weight: 700;
}

/* Progress Bar */
.progress-sec {
    margin-bottom: 18px;
}

.slot-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    color: #a0b3d9;
}

.bar-bg {
    height: 10px;
    background: #2d3748;
    border-radius: 20px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #38bdf8);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons */
.btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.sub-btn {
    background: #2d3748;
    color: white;
    border: none;
    padding: 12px 5px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.sub-btn:hover {
    background: #3f4a61;
    transform: translateY(-2px);
}

.btn-join {
    flex: 1;
    background: var(--accent);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--accent-dark);
    transition: all 0.2s ease;
    animation: pulse-accent 2s infinite;
}

.btn-join:hover {
    filter: brightness(1.1);
}

.btn-join:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--accent-dark);
    animation: none;
}

.btn-join:disabled {
    background: #4b5563;
    box-shadow: 0 5px 0 #2d3748;
    opacity: 0.7;
    transform: none;
    pointer-events: none;
    animation: none;
}

@keyframes pulse-accent {
    0% { box-shadow: 0 5px 0 var(--accent-dark), 0 0 0 0 rgba(14, 165, 233, 0.4); }
    70% { box-shadow: 0 5px 0 var(--accent-dark), 0 0 0 10px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 5px 0 var(--accent-dark), 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 15px;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1a202c;
    width: 100%;
    max-width: 420px;
    border-radius: 32px;
    padding: 24px;
    border: 1px solid var(--accent);
    max-height: 80vh;
    overflow-y: auto;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-swal-input {
    background: #1c2437 !important;
    color: white !important;
    border: 1px solid #3f4e6b !important;
    border-radius: 16px !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    transition: 0.3s ease;
    outline: none;
    width: 100%;
}

.custom-swal-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 10px rgba(14,165,233,0.2) !important;
}

/* Support Box */
.support-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: white;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
}

.support-box:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.6);
    color: white;
}

/* Spinner for verification */
.spinner {
    width: 65px;
    height: 65px;
    margin-bottom: 25px;
    border: 8px solid rgba(14, 165, 233, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinnerRotate 1.5s linear infinite;
}

@keyframes spinnerRotate {
    100% { transform: rotate(360deg); }
}

/* Joined Team Card */
.joined-team-card {
    background: #1a202c;
    border: 1px solid #2a3346;
    border-radius: 20px;
    padding: 15px;
    margin: 10px 0 20px 0;
    display: none;
    animation: fadeUp 0.5s ease-out;
}

.joined-team-card h5 {
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

/* Slot Selector */
.slot-selector-container {
    text-align: left;
    margin-top: 15px;
}

.slot-option {
    display: flex;
    align-items: center;
    background: #2d3748;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.3s ease;
}

.slot-option:hover {
    background: #3f4e6b;
}

.slot-option input {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.slot-option label {
    cursor: pointer;
    flex: 1;
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a202c;
}

::-webkit-scrollbar-thumb {
    background: #3f4e6b;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}