* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14pt;
    line-height: 1.5;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

h2 {
    color: #444;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

/* =============================================
   TOP BAR (Fixed header with hamburger and notifications)
   ============================================= */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 1001;
}

/* Hamburger Toggle Button */
.sidebar-toggle {
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: #555;
}

.hamburger-icon {
    position: relative;
    width: 22px;
    height: 2px;
    background: white;
    transition: background 0.2s;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: white;
    transition: transform 0.3s ease;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    bottom: -7px;
}

/* Hamburger to X transformation when sidebar open */
.sidebar-open .hamburger-icon {
    background: transparent;
}

.sidebar-open .hamburger-icon::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-open .hamburger-icon::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #333;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-open .sidebar {
    transform: translateX(0);
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    padding-top: 70px; /* Space for top bar */
}

.sidebar-link {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14pt;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #555;
}

.sidebar-footer {
    border-top: 1px solid #444;
    padding: 15px 20px;
}

.user-info {
    color: #aaa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 12pt;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Body adjustment for fixed top bar */
body {
    padding-top: 70px;
}

/* =============================================
   MOBILE RESPONSIVENESS
   ============================================= */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
    }

    .notification-dropdown {
        width: calc(100vw - 30px);
        max-width: 350px;
        right: -10px;
    }
}

/* Cards/Sections */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Forms */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14pt;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #007bff;
}

/* Buttons */
button, .btn {
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14pt;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

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

.btn-success:hover {
    background-color: #1e7e34;
}

/* Quiz specific */
.question {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-number {
    font-weight: bold;
    color: #007bff;
}

.question-text {
    margin-bottom: 10px;
}

.question-category {
    font-size: 12pt;
    color: #666;
    margin-bottom: 10px;
}

.answer-box {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14pt;
    resize: vertical;
}

.answer-box:focus {
    outline: none;
    border-color: #007bff;
}

/* Results */
.result-correct {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.result-incorrect {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

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

.your-answer {
    color: #666;
}

.score-display {
    text-align: center;
    padding: 30px;
    font-size: 24pt;
}

.score-passed {
    color: #28a745;
}

.score-failed {
    color: #dc3545;
}

/* History table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #333;
    color: white;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Landing page */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.menu-item {
    background: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.menu-item h3 {
    margin: 0 0 10px 0;
    color: #007bff;
}

.menu-item p {
    margin: 0;
    color: #666;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0.25in;
        padding-top: 0.25in !important;
    }

    .top-bar, .sidebar, .sidebar-overlay, .sidebar-toggle,
    button, .btn, .no-print {
        display: none !important;
    }

    .card, .question {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .answer-box {
        border: 1px solid #999;
        min-height: 0.6in;
    }
}

/* Manual viewer */
.manual-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.manual-content h1 {
    text-align: left;
    font-size: 18pt;
}

.manual-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #ccc;
}

.manual-nav {
    position: sticky;
    top: 60px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.manual-nav a {
    display: block;
    padding: 5px 0;
    color: #333;
    text-decoration: none;
}

.manual-nav a:hover {
    color: #007bff;
}

/* =============================================
   NOTIFICATIONS (in top bar)
   ============================================= */
.notification-container {
    position: relative;
}

.notification-bell {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px 12px;
    color: white;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 16pt;
}

.notification-bell:hover {
    background-color: #555;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 2px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10pt;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.notification-dropdown.active {
    display: block;
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    margin: 0;
    color: #333;
    font-size: 14pt;
}

.notification-header button {
    padding: 5px 10px;
    font-size: 11pt;
}

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

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-item.unread:hover {
    background-color: #d0e8ff;
}

.notification-message {
    color: #333;
    margin-bottom: 5px;
    font-size: 12pt;
}

.notification-time {
    color: #888;
    font-size: 10pt;
}

.notification-empty {
    padding: 30px;
    text-align: center;
    color: #888;
}
