/* =============================================
   RESET & GLOBAL
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(145deg, #0f172a, #1e293b);
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Container umum */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* =============================================
   CARD & FORM
   ============================================= */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    padding: 2rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

/* Form elements */
input, textarea, select {
    width: 100%;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 3rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px #FFD966;
}

input::placeholder, textarea::placeholder {
    color: #ccc;
}

button, .btn-primary {
    background: #FFD966;
    color: #1e2a3a;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    font-size: 1rem;
}

button:hover, .btn-primary:hover {
    transform: scale(1.02);
    background: #ffda6a;
}

.btn-secondary {
    background: #5E2A8C;
    color: white;
}

.btn-secondary:hover {
    background: #7b3fae;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    display: inline-block;
    text-decoration: none;
    border-radius: 2rem;
    margin: 0.2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-sm:hover {
    background: #FFD966;
    color: #1e2a3a;
}

.btn-play {
    background: #2e7d32;
}

.error {
    color: #ff8888;
    margin: 1rem 0;
    text-align: center;
}

.success {
    background: #2e7d32;
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

/* =============================================
   HEADER & NAVIGASI
   ============================================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.8rem;
}

/* =============================================
   QUIZ LIST & CARD (Dashboard)
   ============================================= */
.quiz-list {
    display: grid;
    gap: 1rem;
}

.quiz-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem;
    border-radius: 1.5rem;
    transition: transform 0.2s;
}

.quiz-card:hover {
    transform: translateY(-3px);
}

.quiz-card h3 {
    margin-bottom: 0.5rem;
    color: #FFD966;
}

.quiz-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =============================================
   QUESTION MANAGEMENT (questions.php)
   ============================================= */
.question-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 1rem;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.inline-form input, .inline-form select, .inline-form button {
    width: auto;
    margin: 0;
}

/* =============================================
   WAITING PAGE
   ============================================= */
.waiting-card {
    text-align: center;
}

.participants-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.participant-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.8rem 1.2rem;
    text-align: center;
    backdrop-filter: blur(5px);
    animation: fadeInUp 0.4s ease;
    transition: transform 0.2s;
}

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

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    border: 3px solid #FFD966;
    box-shadow: 0 0 10px rgba(255, 217, 102, 0.5);
}

.participant-name {
    font-weight: 600;
    font-size: 1rem;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FFD966;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* =============================================
   PLAY PAGE (Quiz)
   ============================================= */
.play-card {
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 5rem;
    flex-wrap: wrap;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #FFD966;
    animation: bounce 2s infinite;
}

.score-badge {
    background: #5E2A8C;
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-weight: bold;
}

.timer-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#FFD966 0deg, #4a4a4a 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD966;
    margin: 0 auto;
    transition: background 0.1s linear;
}

.question-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 2rem 0;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.option {
    background: linear-gradient(145deg, #2c3e66, #1a2a4a);
    border: none;
    border-radius: 2rem;
    padding: 1.2rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3);
}

.option:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.option.correct-glow {
    background: #2e7d32;
    box-shadow: 0 0 15px #4caf50;
}

.option.wrong-glow {
    background: #c62828;
    box-shadow: 0 0 15px #f44336;
}

.bible-verse {
    margin-top: 1.5rem;
    font-style: italic;
    font-size: 0.9rem;
}

/* =============================================
   LEADERBOARD (Admin)
   ============================================= */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.rank-1 {
    background: linear-gradient(90deg, #FFD70020, transparent);
    font-weight: bold;
}

.rank-2 {
    background: linear-gradient(90deg, #C0C0C020, transparent);
}

.rank-3 {
    background: linear-gradient(90deg, #CD7F3220, transparent);
}

.avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 10px;
}

.leaderboard-item {
    transition: all 0.3s ease;
}

.leaderboard-item.new {
    animation: slideInLeft 0.4s;
}

/* =============================================
   QR CODE SCANNER (join.php)
   ============================================= */
.qr-reader {
    display: none;
    margin-top: 1rem;
    width: 100%;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    .card {
        padding: 1.2rem;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .option {
        font-size: 1rem;
        padding: 0.8rem;
    }

    .question-text {
        font-size: 1.4rem;
    }

    .player-avatar {
        width: 45px;
        height: 45px;
    }

    .timer-circle {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form input, .inline-form select, .inline-form button {
        width: 100%;
    }

    .leaderboard-table th, .leaderboard-table td {
        padding: 0.5rem;
    }
}

/* =============================================
   MISC
   ============================================= */
a {
    text-decoration: none;
    color: inherit;
}

button:disabled, .option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qr-box {
    text-align: center;
    background: white;
    padding: 0.5rem;
    border-radius: 1rem;
    display: inline-block;
}

/* Scrollbar custom (opsional) */
::-webkit-scrollbar {
    width: 8px;
}

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

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