/* =============================================
   ASTRA GAWALA OLYMPICS – Main Stylesheet
   Colors from logo: deep space dark + neon blue/purple
   ============================================= */

:root {
    --bg-deep: #020b1a;
    --bg-card: #0a1628;
    --bg-card2: #0d1f3c;
    --accent-blue: #00c8ff;
    --accent-purple: #7b35e8;
    --accent-gold: #ffa600;
    --accent-cyan: #4fc3f7;
    --text-main: #e8f4ff;
    --text-muted: #7a9abf;
    --border-glow: rgba(0, 200, 255, 0.3);
    --star-white: #ffffff;
    --neon-shadow: 0 0 20px rgba(0, 200, 255, 0.4);
}

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

html, body {
    min-height: 100vh;
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
}

/* Starfield background */
body {
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(123, 53, 232, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 200, 255, 0.1) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Crect fill='%23020b1a' width='400' height='400'/%3E%3Ccircle fill='white' cx='50' cy='30' r='1'/%3E%3Ccircle fill='white' cx='150' cy='80' r='0.7'/%3E%3Ccircle fill='white' cx='280' cy='20' r='1.2'/%3E%3Ccircle fill='white' cx='320' cy='120' r='0.8'/%3E%3Ccircle fill='white' cx='80' cy='180' r='0.6'/%3E%3Ccircle fill='white' cx='200' cy='200' r='1'/%3E%3Ccircle fill='white' cx='380' cy='90' r='0.9'/%3E%3Ccircle fill='white' cx='10' cy='300' r='0.7'/%3E%3Ccircle fill='white' cx='170' cy='350' r='1.1'/%3E%3Ccircle fill='white' cx='350' cy='280' r='0.8'/%3E%3Ccircle fill='white' cx='100' cy='370' r='0.6'/%3E%3Ccircle fill='white' cx='240' cy='130' r='0.9'/%3E%3Ccircle fill='white' cx='60' cy='250' r='1'/%3E%3Ccircle fill='white' cx='390' cy='350' r='0.7'/%3E%3C/svg%3E");
    background-size: cover, cover, 400px 400px;
}

/* ─── NAVBAR ─────────────────────────────── */
.astra-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 30px;
    background: rgba(2, 11, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glow);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 14px;
}

.astra-nav .nav-logo {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--accent-blue));
}

.astra-nav .nav-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 12px var(--accent-blue);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.astra-nav .nav-slogan {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 1px;
}

/* ─── LANDING PAGE ───────────────────────── */
.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 85px);
    padding: 40px 20px;
    text-align: center;
}

.landing-logo {
    max-width: 320px;
    width: 80%;
    filter: drop-shadow(0 0 30px rgba(0, 200, 255, 0.5));
    animation: floatAnim 3s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.landing-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: 0 0 30px var(--accent-blue), 0 0 60px rgba(0,200,255,0.3);
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.landing-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    letter-spacing: 1px;
}

.btn-start {
    display: inline-block;
    padding: 18px 60px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,200,255,0.5), 0 0 60px rgba(123,53,232,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
}

.btn-start::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.4s;
}

.btn-start:hover {
    transform: scale(1.06);
    box-shadow: 0 0 50px rgba(0,200,255,0.7), 0 0 100px rgba(123,53,232,0.4);
    color: white;
    text-decoration: none;
}

.btn-start:hover::before {
    transform: rotate(45deg) translateX(100%);
}

/* ─── MULTI-STEP FORM ────────────────────── */
.form-container {
    max-width: 680px;
    margin: 40px auto;
    padding: 20px;
}

.form-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--accent-blue);
    transition: all 0.3s;
}

.progress-dot.active {
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
    transform: scale(1.3);
}

.progress-dot.done {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.form-step {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,200,255,0.03);
    animation: stepIn 0.4s ease;
}

.form-step.active {
    display: block;
}

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

.step-number {
    display: inline-block;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-left: 10px;
    box-shadow: 0 0 10px rgba(0,200,255,0.4);
}

.step-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.optional-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card2);
    padding: 2px 10px;
    border-radius: 20px;
    margin-right: 8px;
    font-weight: 400;
}

.astra-label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.astra-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card2);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    direction: rtl;
}

.astra-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0,200,255,0.2);
}

.astra-input.error {
    border-color: #ff4757;
    box-shadow: 0 0 10px rgba(255,71,87,0.2);
}

.tribe-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tribe-option {
    display: none;
}

.tribe-option + label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card2);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.tribe-option + label:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0,200,255,0.1);
}

.tribe-option:checked + label {
    border-color: var(--accent-blue);
    background: rgba(0, 200, 255, 0.08);
    box-shadow: 0 0 20px rgba(0,200,255,0.15);
}

.tribe-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

/* Photo upload */
.photo-upload-area {
    border: 2px dashed var(--border-glow);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-card2);
    position: relative;
}

.photo-upload-area:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0,200,255,0.1);
}

.photo-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.photo-preview {
    max-width: 180px;
    max-height: 180px;
    border-radius: 12px;
    margin-top: 14px;
    display: none;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(0,200,255,0.3);
}

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

.game-option {
    display: none;
}

.game-option + label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card2);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    user-select: none;
}

.game-option + label:hover {
    border-color: var(--accent-cyan);
}

.game-option:checked + label {
    border-color: var(--accent-cyan);
    background: rgba(79, 195, 247, 0.1);
    color: var(--accent-cyan);
}

.game-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.game-option:checked + label .game-check {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.game-option:checked + label .game-check::after {
    content: '✓';
    color: var(--bg-deep);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Buttons */
.btn-next, .btn-prev, .btn-submit {
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 0 20px rgba(0,200,255,0.3);
}

.btn-next:hover, .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0,200,255,0.5);
}

.btn-prev {
    background: var(--bg-card2);
    color: var(--text-muted);
    border: 1px solid var(--border-glow);
}

.btn-prev:hover {
    color: var(--text-main);
    border-color: var(--accent-blue);
}

.step-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 12px;
}

/* Error messages */
.field-error {
    color: #ff4757;
    font-size: 0.82rem;
    margin-top: 6px;
    display: none;
}

.field-error.show {
    display: block;
}

/* ─── THANK YOU PAGE ─────────────────────── */
.thankyou-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 85px);
    padding: 40px 20px;
    text-align: center;
}

.thankyou-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.thankyou-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: 0 0 20px var(--accent-blue);
    margin-bottom: 14px;
}

.thankyou-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 36px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 25px rgba(37,211,102,0.4);
    transition: all 0.2s;
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(37,211,102,0.6);
    color: white;
    text-decoration: none;
}

/* ─── ADMIN ──────────────────────────────── */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 15px rgba(0,200,255,0.4);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: 0 0 15px rgba(0,200,255,0.4);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-glow);
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-glow);
}

.players-table th {
    background: var(--bg-card2);
    color: var(--accent-blue);
    padding: 14px 16px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.players-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,200,255,0.08);
    vertical-align: middle;
    font-size: 0.88rem;
    color: var(--text-main);
}

.players-table tr:last-child td {
    border-bottom: none;
}

.players-table tr:hover td {
    background: rgba(0,200,255,0.04);
}

.player-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 8px rgba(0,200,255,0.3);
}

.player-photo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.tribe-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.tribe-سمسم { background: rgba(0,200,255,0.15); color: var(--accent-cyan); border: 1px solid rgba(0,200,255,0.3); }
.tribe-برنس { background: rgba(123,53,232,0.15); color: #a47aff; border: 1px solid rgba(123,53,232,0.3); }
.tribe-بيبو { background: rgba(255,166,0,0.15); color: var(--accent-gold); border: 1px solid rgba(255,166,0,0.3); }

.game-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(79,195,247,0.1);
    border: 1px solid rgba(79,195,247,0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin: 2px;
}

.game-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 0 8px rgba(0,200,255,0.3);
}

/* Checkbox toggle */
.select-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.select-toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card2);
    border: 2px solid var(--border-glow);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    right: 2px;
    transition: all 0.3s;
}

.select-toggle input:checked + .toggle-slider {
    background: rgba(0,200,255,0.15);
    border-color: var(--accent-blue);
}

.select-toggle input:checked + .toggle-slider::before {
    background: var(--accent-blue);
    transform: translateX(-20px);
    box-shadow: 0 0 8px var(--accent-blue);
}

/* No-player games list */
.no-players-games {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.no-player-tag {
    padding: 6px 14px;
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.3);
    border-radius: 20px;
    color: #ff6b7a;
    font-size: 0.85rem;
}

.filter-sort {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-sort select, .filter-sort input {
    padding: 10px 16px;
    background: var(--bg-card2);
    border: 1px solid var(--border-glow);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    direction: rtl;
}

.filter-sort select:focus, .filter-sort input:focus {
    border-color: var(--accent-blue);
}

/* Admin login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 85px);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 50px 40px;
    width: 360px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }

/* Server-side error */
.validation-error {
    color: #ff6b7a;
    font-size: 0.82rem;
    margin-top: 5px;
    display: block;
}

/* ─── RESPONSIVE ─────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
    .admin-container { padding: 20px 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-sort { flex-wrap: wrap; }
    .filter-sort select, .filter-sort input { flex: 1 1 140px; }
}

/* Mobile (large) */
@media (max-width: 600px) {
    /* Nav */
    .astra-nav { padding: 12px 16px; gap: 10px; }
    .nav-title { font-size: 1.1rem; }
    .nav-slogan { font-size: 0.7rem; }
    .nav-logo { height: 40px; }

    /* Landing */
    .landing-logo { max-width: 220px; }
    .landing-title { font-size: 2rem; letter-spacing: 2px; }
    .landing-subtitle { font-size: 0.95rem; }
    .btn-start { padding: 14px 40px; font-size: 1.1rem; }

    /* Form */
    .form-container { padding: 14px 12px; }
    .form-step { padding: 22px 16px; border-radius: 14px; }
    .step-title { font-size: 1.1rem; }
    .games-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .game-option + label { padding: 10px 12px; font-size: 0.82rem; }
    .step-nav { flex-direction: column-reverse; gap: 10px; }
    .btn-next, .btn-prev, .btn-submit { width: 100%; text-align: center; padding: 14px; }

    /* Admin table – horizontal scroll */
    .players-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .players-table { font-size: 0.75rem; min-width: 600px; }
    .players-table th, .players-table td { padding: 10px 8px; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-number { font-size: 1.8rem; }

    /* Thank you */
    .thankyou-title { font-size: 1.6rem; }
    .btn-whatsapp { padding: 14px 24px; font-size: 1rem; }

    /* Login */
    .login-card { width: 100%; margin: 20px; padding: 30px 20px; }
}

/* Mobile (small) */
@media (max-width: 380px) {
    .landing-title { font-size: 1.6rem; }
    .games-grid { grid-template-columns: 1fr; }
    .tribe-option + label { padding: 12px 14px; }
}
