/* CS362 Practice Exam - Basic Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 250px;
}

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

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
}

.sidebar-menu li a:hover {
    background-color: #34495e;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s, opacity 0.2s;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
}

/* Landing Page */
.landing-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.landing-card {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.landing-card h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.landing-card h3 {
    color: #7f8c8d;
    font-weight: normal;
    margin-bottom: 2rem;
}

.disclaimer-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    text-align: left;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.disclaimer-box h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.disclaimer-box p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.password-section {
    text-align: left;
}

.password-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.password-section input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.password-section input:focus {
    outline: none;
    border-color: #3498db;
}

.password-section .btn {
    width: 100%;
}

.error-text {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Page Container */
.page-container {
    max-width: 900px;
    margin: 0 auto;
}

.page-container h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Exam Choice Cards */
.exam-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.choice-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.choice-card h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.choice-details {
    list-style: none;
    margin-bottom: 1.5rem;
}

.choice-details li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.choice-card .btn {
    width: 100%;
}

/* Exam Page */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.progress-info {
    font-size: 1.1rem;
    font-weight: 500;
}

.timer-info {
    font-size: 1.25rem;
    font-weight: bold;
    color: #e74c3c;
}

/* Quick Navigation */
.quick-nav {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.quick-nav-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.quick-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-nav-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.quick-nav-item:hover {
    background: #e0e0e0;
}

.quick-nav-item.current {
    background: #3498db;
    color: white;
}

.quick-nav-item.answered {
    background: #2ecc71;
    color: white;
}

.quick-nav-item.answered.current {
    background: #27ae60;
}

/* Question Area */
.question-area {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.question-context {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.option-item:hover {
    border-color: #bdc3c7;
    background-color: #f9f9f9;
}

.option-item.selected {
    border-color: #3498db;
    background-color: #ebf5fb;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    margin-right: 1rem;
    transform: scale(1.2);
}

.option-text {
    flex: 1;
}

/* Feedback Area (Practice Mode) */
.feedback-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
}

.feedback-area.correct {
    background-color: #d5f4e6;
    border: 1px solid #27ae60;
}

.feedback-area.incorrect {
    background-color: #fdeaea;
    border: 1px solid #e74c3c;
}

#feedback-message {
    font-weight: 500;
}

/* Option states for practice mode after submission */
.option-item.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.option-item.disabled:hover {
    border-color: #e0e0e0;
    background-color: transparent;
}

.option-item.correct-answer {
    border-color: #27ae60 !important;
    background-color: #d5f4e6 !important;
}

.option-item.wrong-answer {
    border-color: #e74c3c !important;
    background-color: #fdeaea !important;
}

.option-item.correct-answer.selected {
    border-color: #27ae60 !important;
    background-color: #d5f4e6 !important;
}

.option-item.wrong-answer.selected {
    border-color: #e74c3c !important;
    background-color: #fdeaea !important;
}

/* Exam Navigation */
.exam-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.exam-nav .btn {
    flex: 1;
    max-width: 200px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

.modal-content .warning-text {
    color: #e74c3c;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Results Page */
.results-container {
    max-width: 900px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.timeout-message {
    color: #e67e22;
    font-weight: 500;
    margin-bottom: 1rem;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.score-correct {
    color: #27ae60;
}

.score-separator {
    color: #7f8c8d;
    margin: 0 0.25rem;
}

.score-total {
    color: #2c3e50;
}

.score-percentage {
    font-size: 1.5rem;
    color: #7f8c8d;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-results {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem;
}

.result-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #ccc;
}

.result-item.correct {
    border-left-color: #27ae60;
    background: linear-gradient(to right, #f0fff4, white);
}

.result-item.incorrect {
    border-left-color: #e74c3c;
    background: linear-gradient(to right, #fff5f5, white);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-number {
    font-weight: bold;
    color: #2c3e50;
}

.result-context {
    font-size: 0.85rem;
    color: #7f8c8d;
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.result-status {
    font-weight: 500;
}

.result-item.correct .result-status {
    color: #27ae60;
}

.result-item.incorrect .result-status {
    color: #e74c3c;
}

.result-question {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.result-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background: #f9f9f9;
}

.result-option.correct-option {
    background: #d5f4e6;
}

.result-option.correct-selected {
    background: #d5f4e6;
    border: 2px solid #27ae60;
}

.result-option.wrong-selected {
    background: #fdeaea;
    border: 2px solid #e74c3c;
}

.result-option.wrong-selected .option-text {
    text-decoration: line-through;
    color: #c0392b;
}

.result-option.wrong-selected .option-marker {
    color: #e74c3c;
}

.option-marker {
    width: 24px;
    color: #27ae60;
    font-weight: bold;
}

.results-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Disclaimer Page */
.disclaimer-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.disclaimer-content h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.disclaimer-content h3:first-child {
    margin-top: 0;
}

.disclaimer-content p {
    color: #666;
}

.credits-list {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.credits-list li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
}

.credits-list li strong {
    color: #2c3e50;
}

.disclaimer-actions {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .layout {
        flex-direction: column;
    }
    
    .exam-choices {
        grid-template-columns: 1fr;
    }
    
    .exam-nav {
        flex-wrap: wrap;
    }
    
    .exam-nav .btn {
        max-width: none;
    }
    
    .quick-nav-item {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 1rem;
    color: #666;
}
