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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #000;
}

.container {
    max-width: 100%;
    margin: 0;
    background: #ffffff;
    overflow: hidden;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: #000000;
    color: white;
    padding: 20px;
    overflow-y: auto;
    border-right: 3px solid #8B4513;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-250px);
}

.sidebar h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B4513;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background: #1a1a1a;
    border-color: #8B4513;
}

.sidebar-nav a.active {
    background: #8B4513;
    font-weight: bold;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #000000;
    color: white;
    border: 2px solid #8B4513;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
}

.content-wrapper {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

.content-wrapper.full-width {
    margin-left: 0;
}

.header {
    background: #000000;
    color: white;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 3px solid #8B4513;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.disclaimer {
    background: rgba(139, 69, 19, 0.2);
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 0.95em;
    border: 1px solid #8B4513;
}

.main-content {
    padding: 40px;
    background: #ffffff;
}

.upload-section {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 30px;
}

.upload-section h3 {
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.5em;
    text-align: center;
}

.upload-hint {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.upload-area {
    border: 3px dashed #8B4513;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background: #f5f5f5;
    border-color: #A0522D;
}

.upload-area.drag-over {
    background: #f0f0f0;
    border-color: #D2691E;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.upload-text {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.file-input-label {
    display: inline-block;
    padding: 15px 35px;
    background: #000000;
    color: white;
    border: 2px solid #8B4513;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.file-input-label:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

.file-name {
    margin-top: 20px;
    color: #000;
    font-weight: 600;
    text-align: center;
    min-height: 24px;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 15px 30px;
    border: 2px solid #8B4513;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

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

.btn-primary:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

.btn-secondary:hover:not(:disabled) {
    background: #f5f5f5;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #000;
    font-weight: 600;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-section {
    display: none;
}

.output-section.active {
    display: block;
}

.score-summary {
    background: #000000;
    color: white;
    padding: 40px;
    border: 3px solid #8B4513;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.score-summary h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
}

.total-score-display {
    font-size: 4em;
    font-weight: bold;
    color: #8B4513;
    margin: 20px 0;
}

.total-score-label {
    font-size: 1.5em;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.score-card {
    background: #ffffff;
    color: #000000;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #8B4513;
}

.score-value {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #8B4513;
}

.score-label {
    font-size: 1.1em;
    color: #000000;
}

.section-breakdown {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.section-breakdown h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #000000;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.breakdown-card {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.breakdown-card h4 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #000000;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 10px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: bold;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #8B4513;
}

.breakdown-label {
    color: #666;
}

.breakdown-value {
    font-weight: 600;
    color: #000000;
}

.section-results {
    background: white;
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.section-header {
    background: #000000;
    color: white;
    padding: 20px 30px;
    margin: -30px -30px 25px -30px;
    border-radius: 6px 6px 0 0;
    font-size: 1.5em;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #8B4513;
}

.section-score {
    font-size: 1.8em;
    color: #8B4513;
}

.question-card {
    margin-bottom: 25px;
    padding: 25px;
    background: #fafafa;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.question-card.correct {
    border-color: #28a745;
    background: #f0fff4;
}

.question-card.incorrect {
    border-color: #dc3545;
    background: #fff5f5;
}

.question-card.partial {
    border-color: #ffc107;
    background: #fffbf0;
}

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

.question-number {
    font-weight: bold;
    font-size: 1.2em;
    color: #000000;
}

.question-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.status-correct {
    background: #28a745;
    color: white;
}

.status-incorrect {
    background: #dc3545;
    color: white;
}

.status-partial {
    background: #ffc107;
    color: #000000;
}

.question-text {
    color: #000000;
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.answer-comparison {
    background: white;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 15px;
}

.answer-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    color: #000000;
}

.answer-label {
    font-weight: 600;
    color: #666;
}

.answer-value {
    font-weight: bold;
    color: #000000;
}

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

.answer-incorrect {
    color: #dc3545;
}

.marks-info {
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: #000000;
}

.error {
    background: #fff5f5;
    color: #dc3545;
    padding: 20px;
    border-radius: 6px;
    border: 2px solid #dc3545;
    margin-bottom: 25px;
    display: none;
}

.error.active {
    display: block;
}

.footer {
    background: #000000;
    color: #fff;
    padding: 30px;
    text-align: center;
    border-top: 3px solid #8B4513;
}

.footer a {
    color: #73ff00;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: #D2691E;
    text-decoration: underline;
}

.credits {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 0.9em;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .content-wrapper {
        margin-left: 0;
    }

    .header h1 {
        font-size: 1.8em;
    }
    
    .controls {
        flex-direction: column;
    }

    .score-grid {
        grid-template-columns: 1fr;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .total-score-display {
        font-size: 3em;
    }

    .upload-area {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 20px;
    }

    .main-content {
        padding: 20px;
    }

    .section-results {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding: 15px 20px;
        margin: -20px -20px 20px -20px;
    }

    .total-score-display {
        font-size: 2.5em;
    }

    .score-value {
        font-size: 2em;
    }
}
