/* ==========================================================================
   CODINGER Mini CTF - Egyptian Cyber Theme Stylesheet
   Brand Colors: Purple (#8b5cf6), Cyan (#06b6d4), Green (#10b981), Gold (#f59e0b)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Fira+Code:wght@400;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    --bg-dark: #070a12;
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --border-color: rgba(148, 163, 184, 0.15);
    
    --brand-purple: #a855f7;
    --brand-cyan: #06b6d4;
    --brand-green: #10b981;
    --brand-gold: #f59e0b;
    --brand-red: #ef4444;
    
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.35);
    --glow-gold: 0 0 20px rgba(245, 158, 11, 0.35);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.35);
    --glow-green: 0 0 20px rgba(16, 185, 129, 0.35);
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: #e2e8f0;
    font-family: var(--font-en), var(--font-ar);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Lighter muted text */
.text-muted {
    color: #cbd5e1 !important;
}

/* ==================== Page Loader ==================== */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background:
        radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
        #070a12;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-ring {
    position: relative;
    width: 92px;
    height: 92px;
    margin-bottom: 22px;
}
.loader-ring span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--brand-cyan);
    border-bottom-color: var(--brand-purple);
    animation: loaderSpin 1s linear infinite;
}
.loader-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--brand-gold);
    animation: loaderSpin 0.7s linear infinite reverse;
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}
.loader-logo {
    height: 54px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.6));
}
.loader-text {
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 4px;
    font-size: 0.95rem;
    margin-top: 14px;
    text-shadow: var(--glow-cyan);
}
.loader-dots::after {
    content: '';
    animation: loaderDots 1.2s steps(4, end) infinite;
}
@keyframes loaderDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ==================== Navigation Bar ==================== */
.navbar-codinger {
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.75rem 0;
}

.navbar-brand img {
    height: 64px;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.4));
    transition: transform 0.3s ease;
}
.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: #94a3b8 !important;
    font-weight: 600;
    padding: 0.6rem 1.1rem !important;
    border-radius: 8px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.nav-link:hover, .nav-link.active {
    color: #fff !important;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: var(--glow-cyan);
}

.user-score-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid var(--brand-gold);
    color: #fef08a;
    padding: 6px 14px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: var(--glow-gold);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==================== Egyptian Cyber Headers & Accents ==================== */
.egyptian-border {
    position: relative;
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: var(--bg-card);
    border-radius: 12px;
}
.egyptian-border::before, .egyptian-border::after {
    content: '◆';
    position: absolute;
    color: var(--brand-gold);
    font-size: 10px;
}
.egyptian-border::before { top: 4px; right: 6px; }
.egyptian-border::after { bottom: 4px; left: 6px; }

.hieroglyph-bar {
    letter-spacing: 6px;
    color: rgba(245, 158, 11, 0.4);
    font-size: 0.85rem;
    user-select: none;
}

.glow-title {
    background: linear-gradient(135deg, #fff 20%, var(--brand-cyan) 60%, var(--brand-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

/* ==================== Cards & Glassmorphism ==================== */
.cyber-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.cyber-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--brand-cyan), var(--brand-purple), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cyber-card:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.3);
    background: var(--bg-card-hover);
}
.cyber-card:hover::before {
    opacity: 1;
}

.cyber-card.is-solved {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(6, 78, 59, 0.2);
}
.cyber-card.is-solved::before {
    background: var(--brand-green);
    opacity: 1;
}

/* ==================== Difficulty Badges ==================== */
.badge-diff {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-diff-Easy {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-diff-Medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-diff-Hard {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.badge-diff-Insane {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.5);
    box-shadow: var(--glow-purple);
}

.points-pill {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* ==================== Buttons & Interactive Elements ==================== */
.btn-cyber {
    background: linear-gradient(135deg, var(--brand-cyan), #0284c7);
    color: #041019;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    transition: all 0.25s ease;
    box-shadow: var(--glow-cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-cyber:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
    color: #000;
}

.btn-cyber-gold {
    background: linear-gradient(135deg, var(--brand-gold), #d97706);
    color: #1c1002;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    transition: all 0.25s ease;
    box-shadow: var(--glow-gold);
}
.btn-cyber-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
    color: #000;
}

.btn-cyber-outline {
    background: transparent;
    color: var(--brand-cyan);
    border: 1px solid var(--brand-cyan);
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 18px;
    transition: all 0.25s ease;
}
.btn-cyber-outline:hover {
    background: rgba(6, 182, 212, 0.15);
    color: #fff;
    box-shadow: var(--glow-cyan);
}

/* ==================== Form Controls & Terminal Inputs ==================== */
.cyber-input {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    color: #38bdf8 !important;
    font-family: var(--font-mono);
    border-radius: 8px !important;
    padding: 10px 16px !important;
    transition: all 0.25s ease;
}
.cyber-input:focus {
    border-color: var(--brand-cyan) !important;
    box-shadow: var(--glow-cyan) !important;
    outline: none;
}
.cyber-input::placeholder {
    color: #475569 !important;
}

/* ==================== 3-Tier Hints Accordion ==================== */
.hints-container {
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
    padding: 12px;
}
.hint-box {
    border: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.6);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.hint-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.hint-content {
    padding: 14px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.92rem;
    line-height: 1.6;
    color: #e2e8f0;
}
.hint-locked {
    filter: blur(4px);
    user-select: none;
}

/* ==================== Leaderboard Styling ==================== */
.table-leaderboard {
    color: #e2e8f0;
    vertical-align: middle;
}
.table-leaderboard tr {
    border-color: rgba(148, 163, 184, 0.1);
    transition: background 0.2s ease;
}
.table-leaderboard tbody tr:hover {
    background: rgba(30, 41, 59, 0.5);
}
.rank-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
}
.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}
.rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #000;
    box-shadow: 0 0 15px rgba(226, 232, 240, 0.5);
}
.rank-3 {
    background: linear-gradient(135deg, #f97316, #b45309);
    color: #000;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.5);
}

/* ==================== Terminal & Code Blocks ==================== */
.terminal-window {
    background: #020617;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    font-family: var(--font-mono);
}
.terminal-bar {
    background: #0f172a;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-body {
    padding: 16px;
    color: #38bdf8;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
}

/* ==================== SweetAlert2 Dark Cyber Customization ==================== */
div:where(.swal2-container).swal2-backdrop-show {
    background: rgba(2, 6, 23, 0.85) !important;
    backdrop-filter: blur(8px) !important;
}
div:where(.swal2-popup) {
    background: #0f172a !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.3) !important;
    border-radius: 16px !important;
    color: #f8fafc !important;
    font-family: var(--font-en), var(--font-ar) !important;
}
div:where(.swal2-title) {
    color: #38bdf8 !important;
    font-weight: 800 !important;
}
div:where(.swal2-html-container) {
    color: #94a3b8 !important;
}
div:where(.swal2-actions) button {
    border-radius: 8px !important;
    font-weight: 700 !important;
    padding: 10px 22px !important;
}

/* ==================== Footer ==================== */
footer {
    margin-top: auto;
    background: rgba(7, 10, 18, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 30px 0 20px;
}

/* ==================== Custom Scrollbar ==================== */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-cyan) rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand-cyan), var(--brand-purple));
    border-radius: 8px;
    border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22d3ee, #c084fc);
    box-shadow: var(--glow-cyan);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* ==================== Custom Neon Cursor ==================== */

/* Default: Cyan Crosshair Reticle */
html {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%2306b6d4' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Cpath d='M12 0v4M12 20v4M0 12h4M20 12h4'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='1.5' fill='%2306b6d4'/%3E%3C/svg%3E") 12 12, auto;
}

/* Interactive: Gold Target Reticle */
a, button, [role='button'], select, label, summary,
input[type='submit'], input[type='button'], input[type='reset'],
input[type='checkbox'], input[type='radio'],
.hint-header, .cyber-card {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='7' fill='rgba(245,158,11,0.25)' stroke='%23f59e0b' stroke-width='1.5'/%3E%3Ccircle cx='11' cy='11' r='2' fill='%23f59e0b'/%3E%3C/svg%3E") 11 11, pointer;
}

/* Text Fields: Keep I-Beam */
input[type='text'], input[type='password'], input[type='email'],
input[type='number'], input[type='tel'], input[type='url'],
input[type='search'], input[type='date'], textarea {
    cursor: text;
}
