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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative; /* Ensure proper positioning */
}

.progress-indicator {
    font-size: 1.1em;
    font-weight: 500;
}

.exam-title {
    font-size: 1.5em;
    font-weight: 600;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.sidebar.collapsed {
    padding: 20px 20px 10px 20px; /* Reduce bottom padding when collapsed */
}

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

.question-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    gap: 10px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.sidebar.collapsed .question-list {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
}

.question-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.question-btn.answered {
    background: #e3f2fd;
    border-color: #2196f3;
}

.question-btn.correct {
    background: #c8e6c9;
    border-color: #4caf50;
    color: #2e7d32;
}

.question-btn.incorrect {
    background: #ffcdd2;
    border-color: #f44336;
    color: #c62828;
}

.question-display {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.question-text {
    font-size: 1.2em;
    margin-bottom: 25px;
    line-height: 1.7;
}

.options-container {
    margin-bottom: 30px;
}

.option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.option.correct {
    border-color: #4caf50;
    background-color: #e8f5e8;
}

.option.incorrect {
    border-color: #f44336;
    background-color: #ffebee;
}

.option-key {
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.1em;
    min-width: 25px;
}

.option-text {
    flex: 1;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f5f7fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.results {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
}

.score-summary {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 2em;
    font-weight: bold;
}

.performance-breakdown {
    margin-top: 30px;
}

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

.question-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.result-correct {
    background-color: #4caf50;
}

.result-incorrect {
    background-color: #f44336;
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #666;
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

/* Footer Styles */
.footer {
    margin-top: 30px;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

.footer-content p {
    margin: 5px 0;
}

.footer a {
    color: #667eea;
    text-decoration: none;
}

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