* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #550ff771 0%, #43028583 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}


.mt-15 { margin-top: 15px; }
.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.link-plain { color: beige; text-decoration: none; }
.pill { color: beige; background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 20px; display: inline-block; }
.pill-sm { color: beige; background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 15px; display: inline-block; }
.quiz-card-access { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }
.student-history { background: rgba(255,255,255,0.95); margin: 20px 0; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.history-title { color: #4a5568; margin-bottom: 15px; display: flex; align-items: center; }
.history-grid { display: grid; gap: 10px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #f7fafc; border-radius: 8px; }

.quiz-selection {
    background: rgba(255, 255, 255, 0.5)!important;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Ensure minimum spacing between interactive elements */
@media (max-width: 768px) {
    .quiz-grid {
        gap: 18px;
    }
}

@media (max-width: 480px) {
    .quiz-grid {
        gap: 15px;
    }
}

.quiz-card {
    background: linear-gradient(135deg, #313eff 10%, #23287a 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    max-width: 380px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.quiz-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.quiz-card h3 {
    font-size: 1.6rem;
    margin: 0 0 15px 0;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.quiz-card p {
    margin: 8px 0;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    line-height: 1.4;
}

.quiz-card.custom-quiz {
    border-left: 4px solid #667eea;
}

.quiz-card.custom-quiz h3::before {
    content: "👤 ";
}

.quiz-description {
    font-style: italic;
    color: #888 !important;
    font-size: 0.85rem !important;
}

.start-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 14px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.admin-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.custom-quiz-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%) !important;
    color: #333 !important;
}

.timer {
    font-size: 18px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    color: #4a5568 !important;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    min-width: 100px;
    text-align: center;
    transition: all 0.3s ease;
}

.timer.warning {
    border-color: #ffc107;
    color: #ffc107;
    background: #fff3cd;
}

.timer.danger {
    border-color: #dc3545;
    color: #dc3545;
    background: #f8d7da;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Question Manager Styles */
.question-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.question-header {
    background: #f8f9fa;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.question-header h3 {
    margin: 0;
    color: #333;
}

.question-actions {
    display: flex;
    gap: 8px;
}

.question-content {
    padding: 20px;
}

.options {
    margin: 15px 0;
}

.option {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 4px;
    position: relative;
}

.option.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.correct-indicator {
    color: #28a745;
    font-weight: bold;
    margin-left: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}


/* Quiz Interface Styles */
.quiz-interface {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.quiz-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.quiz-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.quiz-header .quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 600px) {
    .quiz-header .quiz-info {
        justify-content: center;
    }
}

.quiz-header .question-counter {
    background: rgba(255,255,255,0.9);
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.question-container {
    margin: 30px 0;
}

.question-text {
    font-size: 1.4rem;
    margin-bottom: 35px;
    color: #1a202c;
    line-height: 1.7;
    font-weight: 600;
    text-align: center;
    padding: 25px;
    background: linear-gradient(145deg, #e2e8f0, #f7fafc);
    border-radius: 15px;
    border-left: 5px solid #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.options-container {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.option {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 3px solid #cbd5e0;
    border-radius: 15px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #2d3748;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-height: 70px;
    display: flex;
    align-items: center;
    text-align: left;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.option:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
    background: transparent;
    border-radius: 15px 0 0 15px;
    transition: all 0.3s ease;
}

.option:hover {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e0);
    border-color: #667eea;
    color: #1a202c;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.option:hover:before {
    background: #667eea;
}

.option.selected {
    background: linear-gradient(145deg, #667eea, #5a67d8);
    color: white;
    border-color: #4c51bf;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.option.selected:before {
    background: #4c51bf;
}

.option.correct {
    background: linear-gradient(145deg, #48bb78, #38a169);
    color: white;
    border-color: #2f855a;
    animation: correctPulse 0.6s ease-in-out;
}

.option.correct:before {
    background: #2f855a;
}

.option.incorrect {
    background: linear-gradient(145deg, #f56565, #e53e3e);
    color: white;
    border-color: #c53030;
    animation: incorrectShake 0.6s ease-in-out;
}

.option.incorrect:before {
    background: #c53030;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.feedback.correct {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 2px solid #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.feedback.incorrect {
    background: linear-gradient(145deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 2px solid #dc3545;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.explanation {
    margin-top: 10px;
    font-style: italic;
}

.quiz-controls {
    text-align: center;
    margin-top: 30px;
}

/* Quiz Access Form Styles */
.quiz-access-form {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 500px;
    margin: 0 auto;
}

.quiz-access-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.2rem;
    background: #f8f9fa;
    color: #2d3748;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.form-group input::placeholder {
    color: #a0aec0;
}

.error-message {
    background: linear-gradient(145deg, #fed7d7, #feb2b2);
    color: #c53030;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #fc8181;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(197, 48, 48, 0.2);
}

/* Button Styles */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Minimum touch target size */
    box-sizing: border-box;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover:before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(145deg, #5a67d8, #4c51bf);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    background: linear-gradient(145deg, #a0aec0, #9ca3af);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn:disabled:before {
    display: none;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.success-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.success-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.finish-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.finish-btn:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
}

.results-container {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0;
    color: #667eea;
}

.grade {
    font-size: 1.5rem;
    margin: 20px 0;
    padding: 15px 30px;
    border-radius: 25px;
    display: inline-block;
}

.grade.A { background: #c6f6d5; color: #22543d; }
.grade.B { background: #bee3f8; color: #2a4365; }
.grade.C { background: #fefcbf; color: #744210; }
.grade.D { background: #fed7cc; color: #7b341e; }
.grade.F { background: #fed7d7; color: #742a2a; }

.question-results {
    margin-top: 30px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.result-item:last-child {
    border-bottom: none;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Timer Styles */
.timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-icon {
    font-size: 1.2rem;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    animation: tick 1s infinite;
}

@keyframes tick {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Quiz Card Improvements */
.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-card:hover::before {
    opacity: 1;
}

/* Progress Bar Enhancement */
.quiz-progress {
    background: #e2e8f0;
    height: 12px;
    border-radius: 6px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 6px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Tablet and smaller desktop screens */
@media (max-width: 1024px) {
    .container {
        padding: 20px 15px;
    }
    
    .quiz-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 18px;
    }
    
    .quiz-card {
        padding: 25px 20px;
        min-height: 190px;
    }
    
    .modal-content {
        width: 85%;
        margin: 3% auto;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        min-width: 120px;
        padding: 10px 8px;
        font-size: 0.9rem;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
    .container {
        padding: 15px 10px;
    }
    
    header {
        margin-bottom: 25px;
    }
    
    header h1 {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    header p {
        font-size: 1rem;
    }
    
    header div {
        margin-top: 12px !important;
    }
    
    header a {
        display: inline-block;
        margin: 5px 8px 5px 0 !important;
        padding: 6px 12px !important;
        font-size: 0.9rem;
    }
    
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        justify-items: center;
    }
    
    .quiz-card {
        padding: 20px 18px;
        min-height: 170px;
        margin-bottom: 10px;
        width: 90%;
        max-width: 400px;
    }
    
    .quiz-card h3 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .quiz-card p {
        font-size: 0.95rem;
        margin: 6px 0;
        line-height: 1.3;
    }
    
    .start-btn {
        padding: 12px 22px;
        font-size: 0.95rem;
        margin-top: 15px;
    }
    
    .quiz-selection {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .quiz-selection h2 {
        font-size: 1.7rem;
        margin-bottom: 25px;
    }
    
    .quiz-interface {
        padding: 20px 15px;
    }
    
    .quiz-header {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .quiz-header h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .quiz-header .quiz-info {
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
    }
    
    .question-counter, .timer {
        align-self: center;
    }
    
    .question-text {
        font-size: 1.2rem;
        padding: 20px 15px;
        margin-bottom: 25px;
        line-height: 1.6;
    }
    
    .options-container {
        gap: 15px;
        margin: 25px 0;
    }
    
    .option {
        padding: 16px 18px;
        font-size: 1rem;
        min-height: 60px;
        line-height: 1.4;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
        margin: 8px 5px;
        min-width: 120px;
    }
    
    .quiz-controls {
        margin-top: 25px;
    }
    
    .timer {
        font-size: 1rem;
        padding: 8px 14px;
        min-width: 90px;
    }
    
    .feedback {
        padding: 18px 15px;
        font-size: 1rem;
        margin-top: 18px;
    }
    
    .modal-content {
        width: 92%;
        margin: 5% auto;
        padding: 0;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input, .form-group textarea, .form-group select {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .admin-tabs {
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .admin-tab {
        padding: 12px;
        font-size: 1rem;
    }
    
    .quiz-grid-admin {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quiz-card-admin {
        padding: 18px 15px;
    }
    
    .quiz-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .quiz-actions .btn {
        flex: 1;
        min-width: 80px;
        margin: 2px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .stat-card {
        padding: 15px !important;
    }
    
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    .stat-card p {
        font-size: 0.9rem !important;
    }
}

/* Mobile portrait */
@media (max-width: 500px) {
    .container {
        padding: 12px 8px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    header div {
        margin-top: 10px !important;
    }
    
    header a {
        display: block;
        margin: 8px 0 !important;
        padding: 8px 12px !important;
        text-align: center;
        border-radius: 15px !important;
        font-size: 0.85rem;
    }
    
    .quiz-selection {
        padding: 18px 12px;
        margin-bottom: 15px;
    }
    
    .quiz-selection h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .quiz-card {
        padding: 18px 15px;
        min-height: 150px;
        margin-bottom: 12px;
    }
    
    .quiz-card h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    .quiz-card p {
        font-size: 0.9rem;
        margin: 5px 0;
        line-height: 1.3;
    }
    
     .start-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        margin: 12px auto 0 auto;
        width: 100%;
        max-width: 200px;
        display: block;
    }
    .quiz-interface {
        padding: 15px 10px;
    }
    
    .quiz-header {
        padding: 15px 12px;
        margin-bottom: 20px;
    }
    
    .quiz-header h2 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .quiz-header .quiz-info {
        gap: 10px;
        margin-top: 12px;
    }
    
    .question-counter {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .question-text {
        font-size: 1.1rem;
        padding: 15px 12px;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .options-container {
        gap: 12px;
        margin: 20px 0;
    }
    
    .option {
        padding: 14px 15px;
        font-size: 0.95rem;
        min-height: 55px;
        line-height: 1.3;
        text-align: center;
    }
    
    .btn {
        padding: 12px 18px;
        font-size: 0.9rem;
        margin: 6px 3px;
        min-width: 90px;
        display: block;
        width: 100%;
        max-width: 200px;
        margin-left: 6px;
        margin-right: 6px;
    }
    
    .quiz-controls {
        margin-top: 20px;
    }
    
    .timer {
        font-size: 0.9rem;
        padding: 6px 10px;
        min-width: 80px;
    }
    
    .feedback {
        padding: 15px 12px;
        font-size: 0.95rem;
        margin-top: 15px;
    }
    
    .results-container {
        padding: 25px 15px;
    }
    
    .score-display {
        font-size: 2.2rem;
        margin: 15px 0;
    }
    
    .grade {
        font-size: 1.2rem;
        padding: 12px 20px;
        margin: 15px 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 8% auto;
        max-height: 80vh;
    }
    
    .modal-header {
        padding: 15px 18px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 18px 15px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .form-group input, .form-group textarea, .form-group select {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .admin-tabs {
        flex-direction: column;
        margin-bottom: 12px;
    }
    
    .admin-tab {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .quiz-card-admin {
        padding: 15px 12px;
    }
    
    .quiz-card-admin h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .quiz-stats {
        flex-direction: column;
        gap: 8px;
        font-size: 0.85rem;
    }
    
    .quiz-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .quiz-actions .btn {
        width: 100%;
        margin: 2px 0;
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .quiz-share {
        margin: 8px 0 !important;
        padding: 8px !important;
    }
    
    .quiz-share span {
        display: block;
        margin: 5px 0;
        word-break: break-all;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .stat-card {
        padding: 12px !important;
    }
    
    .stat-card h3 {
        font-size: 1.3rem !important;
    }
    
    .stat-card p {
        font-size: 0.85rem !important;
    }
    
    #results-table {
        font-size: 0.8rem;
    }
    
    #results-table th, #results-table td {
        padding: 8px 4px !important;
    }
    
    .question-item {
        margin-bottom: 15px;
    }
    
    .question-header {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .question-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .question-content {
        padding: 15px 12px;
    }
    
    .quiz-access-form {
        padding: 25px 15px;
        max-width: 100%;
        margin: 0;
    }
    
    .quiz-access-form h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
}

/* Floating Bubbles Background Effect */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 12s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-duration: 16s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 25%;
    animation-duration: 18s;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 30px;
    height: 30px;
    left: 40%;
    animation-duration: 14s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    width: 50px;
    height: 50px;
    left: 70%;
    animation-duration: 20s;
    animation-delay: 3s;
}

.bubble:nth-child(6) {
    width: 25px;
    height: 25px;
    left: 80%;
    animation-duration: 15s;
    animation-delay: 7s;
}

.bubble:nth-child(7) {
    width: 35px;
    height: 35px;
    left: 32%;
    animation-duration: 17s;
    animation-delay: 15s;
}

.bubble:nth-child(8) {
    width: 45px;
    height: 45px;
    left: 55%;
    animation-duration: 19s;
    animation-delay: 2s;
}

.bubble:nth-child(9) {
    width: 15px;
    height: 15px;
    left: 65%;
    animation-duration: 13s;
    animation-delay: 6s;
}

.bubble:nth-child(10) {
    width: 55px;
    height: 55px;
    left: 85%;
    animation-duration: 16s;
    animation-delay: 8s;
}

.bubble:nth-child(11) {
    width: 28px;
    height: 28px;
    left: 15%;
    animation-duration: 21s;
    animation-delay: 10s;
}

.bubble:nth-child(12) {
    width: 38px;
    height: 38px;
    left: 90%;
    animation-duration: 14s;
    animation-delay: 12s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced bubble variants for more visual interest */
.bubble.variant-1 {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.bubble.variant-2 {
    background: rgba(118, 75, 162, 0.15);
    border-color: rgba(118, 75, 162, 0.3);
}

.bubble.variant-3 {
    background: rgba(240, 147, 251, 0.15);
    border-color: rgba(240, 147, 251, 0.3);
}

/* Music Control Styles */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.music-btn.playing {
    background: rgba(102, 126, 234, 0.8);
    border-color: rgba(102, 126, 234, 1);
    animation: musicPulse 2s infinite;
}

.music-btn.muted {
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(220, 53, 69, 1);
}

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive adjustments for bubbles */
@media (max-width: 768px) {
    .bubble {
        animation-duration: 12s !important;
    }
    
    .bubble:nth-child(odd) {
        display: none;
    }
}

@media (max-width: 480px) {
    .bubble {
        animation-duration: 10s !important;
    }
    
    .bubble:nth-child(n+7) {
        display: none;
    }
}
