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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-footer p,
.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5em;
    margin: 0;
    transition: opacity 0.3s;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-item:hover:not(.disabled) {
    background: #f0f4ff;
    border-left-color: #667eea;
}

.nav-item.active {
    background: #e7f3ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-icon {
    font-size: 1.5em;
    min-width: 30px;
    text-align: center;
}

.nav-text {
    font-size: 1em;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
    font-size: 0.85em;
    transition: opacity 0.3s;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    font-size: 1.5em;
    color: white;
    background: #667eea;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.mobile-menu-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    font-size: 1em;
    margin-bottom: 15px;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.9em;
}

.nav-links a:hover:not(.disabled) {
    background: #667eea;
    color: white;
}

.nav-links a.active {
    background: #667eea;
    color: white;
}

.nav-links a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Upload Section */
.upload-card h2 {
    color: #333;
    margin-bottom: 10px;
}

/* Question Set Selection */
.question-set-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.question-set-selection label {
    display: block;
    color: #333;
    margin-bottom: 10px;
    font-size: 1em;
}

.set-select {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.set-select:hover {
    border-color: #764ba2;
}

.set-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.selection-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.selection-actions .btn {
    flex: 1;
    min-width: 150px;
}

.upload-feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95em;
}

.upload-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upload-feedback.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Mode Selection */
.mode-selection {
    margin: 20px 0;
}

.mode-selection label {
    display: block;
    margin-bottom: 10px;
}

.mode-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    text-align: center;
}

.mode-option input[type="radio"]:checked + .mode-label {
    border-color: #667eea;
    background: #e7f3ff;
}

.mode-label:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mode-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.mode-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 1em;
}

.mode-desc {
    font-size: 0.85em;
    color: #666;
}

/* Mode Indicator */
.mode-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 10px;
}

.mode-indicator.practice {
    background: #d4edda;
    color: #155724;
}

.mode-indicator.test {
    background: #fff3cd;
    color: #856404;
}

/* Answer Feedback */
.answer-feedback {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1em;
    line-height: 1.6;
}

.answer-feedback.correct {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.answer-feedback.incorrect {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.answer-feedback strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.answer-feedback .correct-answer-text {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Floating Submit Button */
.floating-submit {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    animation: fadeInUp 0.3s ease;
}

.floating-submit .btn {
    padding: 15px 30px;
    font-size: 1.1em;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    animation: pulse 2s infinite;
}

.floating-submit .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.5);
}

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(40, 167, 69, 0.6);
    }
}

.info-text {
    color: #666;
    margin-bottom: 20px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-area:hover {
    background: #e7f3ff;
    border-color: #764ba2;
}

.upload-area svg {
    color: #667eea;
    margin-bottom: 15px;
}

.upload-area p {
    color: #333;
    font-size: 1.1em;
    margin: 5px 0;
}

.file-types {
    color: #999;
    font-size: 0.9em !important;
}

.file-info {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin: 5px 0;
    color: #333;
}

.stored-questions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.stored-questions h3 {
    color: #333;
    margin-bottom: 10px;
}

#questionCount {
    color: #666;
    margin-bottom: 15px;
}

/* Practice Section */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.practice-header > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.practice-header h2 {
    color: #333;
    margin: 0;
}

.practice-stats {
    display: flex;
    gap: 20px;
    font-size: 1.1em;
    color: #667eea;
    font-weight: bold;
}

.question-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.question-number {
    color: #667eea;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.option {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.option.selected {
    border-color: #667eea;
    background: #e7f3ff;
}

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

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

.option-label {
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
}

.option-text {
    color: #333;
    flex: 1;
}

.question-navigation {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-exit {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-exit:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

/* Results Section */
.results-card {
    text-align: center;
}

.results-card h2 {
    color: #333;
    margin-bottom: 30px;
}

.score-display {
    margin: 30px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.score-circle span {
    font-size: 3em;
    font-weight: bold;
    color: white;
}

.score-text {
    font-size: 1.2em;
    color: #333;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Review Section */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.review-header h2 {
    color: #333;
}

.review-question {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.review-question.correct {
    border-left-color: #28a745;
}

.review-question.incorrect {
    border-left-color: #dc3545;
}

.review-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.review-question-number {
    font-weight: bold;
    color: #667eea;
}

.review-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.review-status.correct {
    background: #d4edda;
    color: #155724;
}

.review-status.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.review-question-text {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.review-answer {
    margin: 10px 0;
    padding: 10px;
    border-radius: 6px;
}

.review-answer.user {
    background: #e7f3ff;
}

.review-answer.correct-answer {
    background: #d4edda;
}

.review-answer strong {
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .practice-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .practice-header > div:first-child {
        width: 100%;
    }
    
    .practice-stats {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .practice-stats span {
        flex: 1;
        min-width: 120px;
    }
    
    .btn-exit {
        width: 100%;
        margin-top: 10px;
    }
    
    .question-navigation {
        flex-direction: column;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .mode-options {
        flex-direction: column;
    }
    
    .mode-option {
        min-width: 100%;
    }
    
    .selection-actions {
        flex-direction: column;
    }
    
    .selection-actions .btn {
        min-width: 100%;
    }
    
    .floating-submit {
        bottom: 15px;
        right: 15px;
        left: 15px;
    }
    
    .floating-submit .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1em;
    }
}
