.quiz-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
}

.sidebar {
    width: 20%;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    height: 100vh;
    box-sizing: border-box;
}

.sidebar-header {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sidebar .welcome {
    font-size: 20px;
    font-weight: bold;
}

/* Sidebar buttons */
.sidebar-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 10px 12px;
    margin: 8px 0;
    background-color: #c7ab94;   /* your accent from the sidebar */
    color: #2c3e50;               /* readable on the accent */
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.05s ease, filter 0.2s ease, background-color 0.2s ease;
}

.sidebar-btn:hover {
    filter: brightness(0.95);
}

.sidebar-btn:active {
    transform: translateY(1px);
}

/* Optional alt style (e.g., for Admin) */
.sidebar-btn.alt {
    background-color: #9fb3bf;   /* subtle blue-grey to differentiate */
    color: #1f2d38;
}

/* Sidebar “button” links */
.sidebar-btn {
    display: inline-block;
    margin: 6px 0 0 0;
    padding: 8px 10px;
    background: #3f6478;
    color: #ecf0f1;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    width: 100%;
    box-sizing: border-box;
}
.sidebar-btn:hover { filter: brightness(0.95); }
.sidebar-btn.alt { background: #6c7a89; }
.sidebar-btn.ghost { background: #4a6070; }

.topics-list {
    flex: 1 1 auto;           /* fills remaining space */
    overflow-y: auto;         /* only this scrolls */
    margin-bottom: 20px;
}

.topics-list h3 {
    margin-bottom: 10px;
    font-size: 16px;
    text-transform: uppercase;
    border-bottom: 1px solid #7f8c8d;
    padding-bottom: 5px;
}

.topics-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topics-list ul li {
    margin: 8px 0;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.topics-list ul li:hover {
    background-color: #34495e;
}

.topic-item {
    margin-bottom: 10px;
}

.topic-title {
    display: block;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.topic-title:hover {
    background-color: #34495e;
}

.subtopics {
    display: none; /* Hidden by default */
    margin-top: 5px;
    margin-left: 10px;
    padding-left: 10px;
    font-size: 14px;
}

.subtopics li {
    margin: 5px 0 5px 15px;
}

.subtopics li::before {
    content: '››';
    margin-right: 6px;
    color: #c7ab94;
}

.logout-form {
    flex-shrink: 0;          /* stays at bottom */
    margin-top: auto;
}

.logout-button {
    background-color: #e74c3c;
    border: none;
    padding: 10px;
    width: 100%;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.logout-button:hover {
    background-color: #c0392b;
}

.main-content {
    width: 80%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.option {
    list-style-type: none;
    cursor: pointer;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    transition: background-color 0.3s;
}

.option:hover {
    background-color: #eee;
}

.option.correct {
    background-color: #2ecc71;
    color: white;
}

.option.incorrect {
    background-color: #e74c3c;
    color: white;
}

.option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

#quiz-header {
    width: 100%;
    background-color: #3f6478;
    color: #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 15px 40px;
    height: 60px;
    box-sizing: border-box;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;          /* spacing between buttons */
    flex: 0 0 auto;     /* size to content */
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;     /* center grows/shrinks to fill available space */
}

/* Keep the two left buttons on one line */
.header-left { white-space: nowrap; }

#quiz-header button {
    padding: 8px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

#quiz-header button:hover {
    background-color: #c0392b;
}

#next-question-button {
    margin-left: 10px;
    padding: 8px 12px;
    background-color: #3498db;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#next-question-button:hover {
    background-color: #2980b9;
}

#quiz-stats span {
    margin-left: 15px;
    font-size: 14px;
}

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

/* Modal Box */
.modal-content {
    background-color: #ecf0f1;
    padding: 20px 30px;
    border-radius: 8px;
    width: 300px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.quiz-overlay-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    color: #2c2c54;
    font-size: 24px;
    font-weight: bold;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.quiz-overlay-message.fade-out {
    opacity: 0;
}

/* Close Button */
.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

/* Modal Inputs and Button */
#question-count-input {
    width: 60px;
    padding: 5px;
    margin: 10px 0;
    text-align: center;
}

#start-quiz-button {
    padding: 8px 16px;
    background-color: #2ecc71;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-quiz-button:hover {
    background-color: #27ae60;
}

.option.correct-flash {
    background-color: #27ae60;
    color: white;
    font-weight: bold;
}

#img-container {
    width: 100%;
    max-width: 300px;
    height: 150px;
    margin: 20px auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#quiz-container {
    max-width: 100%;
    padding: 20px 10px;
    text-align: left;
}

.question-block h3 {
    margin-bottom: 20px;
    font-size: 1.0em;
}

.question-block ul {
    list-style: none;
    padding: 0;
}

.question-block li.option {
    margin: 8px auto;
    padding: 8px 10px;
    max-width: 90%;
    background-color: #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: left;
}

.question-block li.option:hover {
    background-color: #d0d7de;
}

.question-block li.option.correct,
.question-block li.option.correct-flash {
    background-color: #27ae60;
    color: white;
    font-weight: bold;
}

.question-block li.option.incorrect {
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
}

#report-problem-button { background-color: #7f8c8d; }
#report-problem-button:hover { background-color: #707b7c; }

.subtopic-meta {
    margin: 12px auto 8px auto;
    max-width: 900px;
    background: #f7f9fb;
    border: 1px solid #dde4ea;
    color: #2c3e50;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
}
.subtopic-meta b { font-weight: 700; }

/* Reserve vertical space so nothing shifts when meta content appears */
#meta-wrap {
    min-height: 28px;       /* adjust to your line-height */
    margin: 8px auto 12px;  /* spacing above the image */
    max-width: 90%;
    text-align: center;
}

/* Meta text styling */
.meta-bar {
    font-size: .95rem;
    opacity: .9;
    line-height: 1.6;
}

/* Hide text without collapsing space */
.meta-bar.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Make only the Report Problem modal wider */
#contact-modal .modal-content {
    width: 560px;       /* was 300px globally */
    max-width: 92vw;    /* stay responsive on small screens */
    text-align: left;   /* keep current look */
}

/* Give the textarea more room and comfy typing */
#contact-message {
    width: 100%;
    min-height: 180px;  /* taller box */
    padding: 10px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;   /* allow manual resize if user wants */
}