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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

header h1 {
    margin: 0;
}

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

.user-info span {
    color: #666;
}

.user-info button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.user-info .nav-link {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-form {
    text-align: left;
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.auth-form button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #666;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.divider::after {
    content: 'OR';
    background: white;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    border: 1px solid #ddd;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 10px;
}

.google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #333;
    text-decoration: none;
}

/* Quiz Tabs */
.quiz-tabs {
    display: flex;
    margin-bottom: 20px;
    justify-content: center;
}

.quiz-tabs .tab-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 4px;
    cursor: pointer;
}

.quiz-tabs .tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* My Quiz Styles */
.my-quiz {
    border-left: 4px solid #667eea;
}

.quiz-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.edit-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.start-quiz-btn {
    flex: 2;
}

/* Question Actions */
.question-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.question-actions .edit-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.question-actions .delete-btn {
    flex: 1;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
}

.progress {
    color: #666;
    font-size: 18px;
}

.timer {
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

.question-container {
    margin-bottom: 30px;
}

#question-text {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.option {
    margin: 10px 0;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background: #f5f5f5;
}

.option.correct {
    background: #d4edda;
    border-color: #28a745;
}

.option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

.option input {
    margin-right: 10px;
}

.submit-btn, .next-btn, .results-btn, .restart-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 5px;
}

.submit-btn:hover, .next-btn:hover, .results-btn:hover, .restart-btn:hover {
    background: #5a6fd8;
}

.result {
    margin-top: 20px;
}

.answer-feedback {
    margin: 20px 0;
    font-size: 18px;
}

.correct-msg {
    color: #28a745;
}

.wrong-msg {
    color: #dc3545;
}

.timeout-msg {
    color: #f39c12;
}

.final-results {
    text-align: center;
}

.navigation {
    text-align: center;
    margin-top: 30px;
}

.nav-link, .admin-link, .back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    margin: 0 10px;
}

/* Registration Styles */
.registration-section {
    margin: 30px 0;
    text-align: center;
}

.registration-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.registration-section form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.registration-section input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.registration-section button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* Leaderboard Styles */
.leaderboard-section {
    margin: 30px 0;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.leaderboard-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.leaderboard-table tr:hover {
    background: #f5f5f5;
}

.leaderboard-table tr.current-user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding-left: 8px;
    font-weight: bold;
}

.leaderboard-table tr.current-user:hover {
    background: #bbdefb;
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: white;
    font-size: 14px;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

/* Admin Styles */
.admin-section {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.admin-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-section input, .admin-section select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.admin-section button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.question-item {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.question-item h4 {
    color: #333;
    margin-bottom: 10px;
}

/* Quiz List Styles */
.quiz-list {
    margin: 30px 0;
    text-align: center;
}

.quiz-list h2 {
    margin-bottom: 30px;
    color: #333;
}

#quizzes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.quiz-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quiz-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.quiz-card p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.quiz-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px !important;
}

.start-quiz-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
}

.start-quiz-btn:hover {
    background: #5a6fd8;
}

.create-quiz-btn {
    display: inline-block;
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
}

.create-quiz-btn:hover {
    background: #218838;
}

.admin-section textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-height: 80px;
    resize: vertical;
}

.finish-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

.finish-btn:hover {
    background: #138496;
}

/* Quiz Leaderboard Styles */
.quiz-leaderboard {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.quiz-leaderboard h2 {
    color: #333;
    margin: 0;
    font-size: 24px;
}

.toggle-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-btn:hover {
    background: #5a6fd8;
}

.quiz-creator {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.no-participants {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.quiz-leaderboard .leaderboard-table {
    margin-top: 15px;
}

/* Gamification Styles */
.game-stats {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.stat {
    font-weight: bold;
    color: #495057;
    font-size: 16px;
}

.points {
    color: #28a745;
    font-weight: bold;
}

.bonus {
    color: #ffc107;
    font-weight: bold;
}

.achievement {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: bold;
    text-align: center;
    animation: pulse 2s infinite;
}

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

.streak-indicator {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

.streak-indicator.active {
    background: #28a745;
    animation: glow 1s ease-in-out;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #28a745; }
    50% { box-shadow: 0 0 20px #28a745; }
    100% { box-shadow: 0 0 5px #28a745; }
}

/* Audio Controls */
.mute-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.mute-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

/* Stats Styles */
.stats-container {
    text-align: center;
}

.total-points-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.points-display {
    font-size: 72px;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.points-subtitle {
    font-size: 18px;
    opacity: 0.9;
}

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

.stat-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    margin: 15px 0;
}

.stat-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.motivation-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-align: left;
}

.achievements {
    margin: 20px 0;
}

.achievement-badge {
    display: inline-block;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 10px 15px;
    border-radius: 25px;
    margin: 5px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.next-goals ul {
    list-style: none;
    padding: 0;
}

.next-goals li {
    background: #e3f2fd;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 5px;
    border-left: 4px solid #2196f3;
}

/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chatbot-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.chatbot-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.chatbot-header {
    background: #667eea;
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: scroll;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.message {
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: #667eea;
    color: white;
    align-self: flex-end;
}

.bot-message {
    background: #f1f1f1;
    color: #333;
    align-self: flex-start;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 10px 10px;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 15px; margin: 0; border-radius: 0; }
    header { flex-direction: column; gap: 15px; text-align: center; }
    .user-info { flex-wrap: wrap; justify-content: center; }
    #question-text { font-size: 18px; }
    .option { padding: 12px; font-size: 14px; }
    .submit-btn, .next-btn, .results-btn, .restart-btn { width: 100%; margin: 5px 0; padding: 12px; }
    #quizzes-container { grid-template-columns: 1fr; gap: 15px; }
    .quiz-card { padding: 15px; }
    .game-stats { flex-direction: column; gap: 10px; text-align: center; }
    .leaderboard-table { font-size: 14px; }
    .leaderboard-table th, .leaderboard-table td { padding: 8px 4px; }
    .admin-section { padding: 15px; }
    .quiz-actions { flex-direction: column; }
    .mute-btn { width: 40px; height: 40px; font-size: 16px; top: 10px; right: 10px; }
    .points-display { font-size: 48px; }
    .stat-number { font-size: 36px; }
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 20px; }
    .chatbot-window { width: 300px; height: 350px; }
    .chatbot-container { bottom: 10px; right: 10px; }
}

@media (max-width: 480px) {
    .container { padding: 10px; }
    h1 { font-size: 24px; }
    #question-text { font-size: 16px; }
    .option { padding: 10px; font-size: 13px; }
    .auth-container { padding: 0; }
    .tab-btn { padding: 12px; font-size: 14px; }
    .leaderboard-table { font-size: 12px; }
    .quiz-card h3 { font-size: 16px; }
    .quiz-meta { font-size: 12px; }
}