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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1e 0%, #1a1a3e 50%, #0f0f2e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tech-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    z-index: 1000;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    text-align: center;
    font-size: 3em;
    margin: 60px 0 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5)); }
    to { filter: drop-shadow(0 0 30px rgba(118, 75, 162, 0.8)); }
}

.upload-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    margin-bottom: 40px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.upload-section:hover::before {
    left: 100%;
}

.upload-section:hover {
    border-color: #764ba2;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
}

.upload-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 25px 0;
}

input[type="file"] {
    display: none;
}

.file-input-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 50px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.file-input-label:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.file-input-label:active {
    transform: translateY(-1px) scale(1.02);
}

.pdf-preview {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    display: none;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pdf-preview.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

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

.pdf-preview h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.pdf-preview pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.pdf-preview pre::-webkit-scrollbar {
    width: 8px;
}

.pdf-preview pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.pdf-preview pre::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.controls {
    text-align: center;
    margin: 40px 0;
    display: none;
}

.controls.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.controls button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 10px 10px 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.controls button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.controls button:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#quizContainer {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.question-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border-left: 5px solid transparent;
    border-image: linear-gradient(135deg, #667eea, #764ba2) 1;
    animation: slideIn 0.6s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.3);
}

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

.question-card h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.3em;
    line-height: 1.6;
}

.question-card .answers {
    display: grid;
    gap: 15px;
    margin: 25px 0;
}

.answer-option {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

.answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    transition: left 0.5s ease;
}

.answer-option:hover::before {
    left: 100%;
}

.answer-option:hover:not(.answered) {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    transform: translateX(5px);
}

.answer-option.selected {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.answer-option.correct {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.3);
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.answer-option.incorrect {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.3);
    animation: incorrectShake 0.5s ease;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.answer-option.answered {
    cursor: default;
    opacity: 0.8;
}

.answer-explanation {
    margin-top: 25px;
    padding: 20px;
    background: rgba(46, 204, 113, 0.1);
    border-left: 4px solid #2ecc71;
    border-radius: 12px;
    color: #2ecc71;
    font-weight: bold;
    display: none;
    animation: fadeInUp 0.5s ease;
}

.answer-explanation.visible {
    display: block;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #667eea;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.filename {
    color: #2ecc71;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2.2em;
        margin: 30px 0 20px 0;
    }

    .upload-section {
        padding: 30px 20px;
    }

    .controls button {
        width: 100%;
        margin: 5px 0;
    }

    .tech-badge {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 10px 18px;
    }

    .question-card {
        padding: 20px;
    }
}