/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --warning: #f8961e;
    --danger: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border-bottom: 4px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

/* Upload Section */
.upload-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--gray-light);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.upload-zone {
    border: 3px dashed var(--primary);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover {
    border-color: var(--secondary);
    background: rgba(67, 97, 238, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.upload-zone h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.upload-zone p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.file-info {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 1rem;
}

.upload-tips {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: left;
    border-left: 4px solid var(--success);
}

.upload-tips h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-tips ul {
    list-style: none;
    padding-left: 0;
}

.upload-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.upload-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Progress Bar */
.progress-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 2rem auto 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: var(--gray-light);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    width: 0%;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps:before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--gray-light);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0.5rem;
    color: var(--gray);
}

.step.active {
    color: var(--primary);
    font-weight: 600;
}

.step i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: var(--gray-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step.active i {
    background: var(--primary);
    color: white;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(67, 97, 238, 0.1);
}

/* Questions Section */
.questions-section {
    display: none;
}

.ad-banner {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
}

.ad-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.btn-ad {
    background: white;
    color: #ff6b6b;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ad:hover {
    transform: scale(1.05);
}

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--gray-light);
}

.mini-progress {
    width: 100px;
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.3s ease;
}

/* Concepts Panel */
.concepts-panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.concepts-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.concepts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.concept-tag {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Question Cards */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.question-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.question-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.question-type {
    background: var(--gray-light);
    color: var(--gray);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.option:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
}

.option.correct {
    border-color: var(--success);
    background: rgba(76, 201, 240, 0.1);
}

.option.incorrect {
    border-color: var(--danger);
    background: rgba(247, 37, 133, 0.1);
}

.option-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray);
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: var(--primary);
    color: white;
}

.option.correct .option-letter {
    background: var(--success);
    color: white;
}

.option.incorrect .option-letter {
    background: var(--danger);
    color: white;
}

.option-text {
    flex: 1;
}

.short-answer-input {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

.short-answer-input:focus {
    outline: none;
    border-color: var(--primary);
}

.answer-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(76, 201, 240, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--success);
    display: none;
}

.answer-section.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.correct-answer {
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.answer-explanation {
    color: var(--dark);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(76, 201, 240, 0.3);
}

.question-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Load More Section */
.load-more {
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.hint {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Results Card */
.results-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-top: 4px solid var(--success);
}

.results-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.summary-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-ads {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.copyright {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .upload-card {
        padding: 2rem 1rem;
    }
    
    .controls-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .controls-left, .controls-right {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .ad-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}