@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #050505;
    --primary: #00ff66;
    --primary-dim: rgba(0, 255, 102, 0.2);
    --secondary: #00d2ff;
    --text-color: #e0e0e0;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --error: #ff3366;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 255, 102, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.08), transparent 25%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

/* Cyber accents */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.glass-panel::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-dim), 0 0 20px var(--primary-dim);
    letter-spacing: 2px;
}

.title span {
    color: var(--primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--secondary);
    font-size: 1.1rem;
}

input[type="text"],
input[type="date"],
input[type="password"] {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-dim);
}

.btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary-dim);
}

.btn-secondary {
    color: var(--secondary);
    border-color: var(--secondary);
    margin-top: 15px;
}
.btn-secondary:hover {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.btn-danger {
    color: var(--error);
    border-color: var(--error);
}
.btn-danger:hover {
    background: var(--error);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
}

/* Quiz Specific */
.question-container {
    margin-bottom: 30px;
}
.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.4;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.option {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.option:hover {
    border-color: var(--secondary);
    background: rgba(0, 210, 255, 0.1);
}

.option input[type="radio"] {
    display: none;
}

.option.selected {
    border-color: var(--primary);
    background: rgba(0, 255, 102, 0.15);
    box-shadow: 0 0 10px var(--primary-dim);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.score-badge {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    border: 1px solid var(--primary);
}

/* Leaderboard Specific */
.leaderboard-list {
    list-style: none;
    margin-top: 20px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: transform 0.2s;
}
.leaderboard-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.5);
}

.rank-1 {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}
.rank-2 {
    border-left-color: #c0c0c0;
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}
.rank-3 {
    border-left-color: #cd7f32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.current-user {
    border: 1px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-dim);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rank-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #888;
    width: 30px;
}

.rank-1 .rank-number { color: #ffd700; }
.rank-2 .rank-number { color: #c0c0c0; }
.rank-3 .rank-number { color: #cd7f32; }

.user-score {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}
.alert-error {
    background: rgba(255, 51, 102, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}
.alert-success {
    background: rgba(0, 255, 102, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Admin panel styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.admin-table th {
    color: var(--secondary);
    font-family: 'Orbitron', sans-serif;
}
.action-links a {
    color: var(--primary);
    text-decoration: none;
    margin-right: 10px;
    font-weight: 600;
}
.action-links a.delete {
    color: var(--error);
}

.nav-links {
    text-align: center;
    margin-top: 20px;
}
.nav-links a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--primary);
}

/* NEW FEATURES STYLES */
.timer-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: var(--primary);
    transition: width 1s linear, background 0.3s;
}

.timer-warning {
    background: var(--error);
}

.lifelines {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.btn-lifeline {
    flex: 1;
    padding: 10px;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-lifeline:hover:not(:disabled) {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.btn-lifeline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}

.rank-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #aaa;
    font-family: 'Orbitron', sans-serif;
}

.rank-kiddie { border-color: #aaa; color: #aaa; }
.rank-junior { border-color: var(--secondary); color: var(--secondary); }
.rank-elite { border-color: var(--primary); color: var(--primary); font-weight: bold; text-shadow: 0 0 5px var(--primary); }

.btn-share {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #25D366; /* WhatsApp Green */
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-share:hover {
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
    transform: scale(1.05);
}

/* Typing Animation Overlay */
#typing-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}

#typing-text {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 1.5rem;
    border-right: 2px solid var(--primary);
    white-space: pre-wrap;
    overflow: hidden;
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* ADVANCED FEATURES STYLES */
body {
    user-select: none; /* Anti-copy */
    -webkit-user-select: none;
}

.avatar-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 8px;
}

.avatar-option {
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.2s;
}

.avatar-option:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.avatar-option.selected {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--primary);
}

.ticker-wrap {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid var(--primary);
    overflow: hidden;
    position: absolute;
    top: 0; left: 0;
    z-index: 100;
    padding: 5px 0;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 20s linear infinite;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    font-size: 0.9rem;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}
