/* 
 * CISA Practice Platform - Custom Styles
 * Built on top of Bootstrap 5
 */

:root {

    --primary-color: #6f42c1;
    --primary-hover: #c0392b;
    --primary-light: rgba(67, 97, 238, 0.08);
    --sidebar-bg: #ffffff;
    --sidebar-color: #64748b;
    --sidebar-active-bg: var(--primary-color);
    --sidebar-active-color: #ffffff;
    --sidebar-width: 260px;
    --header-height: 70px;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --text-primary: #444;
    --text-secondary: #777;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* Guest Layout */
.guest-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.guest-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.guest-brand {
    text-align: center;
    margin-bottom: 30px;
}

.guest-brand i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: inline-block;
}

.guest-brand h1 {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* ==========================================
   SIDEBAR - Modern White Design
   ========================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

/* Brand / Logo */
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.table th {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    font-size: 14px;
}

.sidebar-brand i {
    width: 38px;
    height: 38px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Navigation */
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a,
.sidebar-link-btn {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    color: var(--sidebar-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.925rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    gap: 14px;
}

.sidebar-nav a:hover,
.sidebar-link-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.sidebar-nav li.active a {
    color: #ffffff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.sidebar-nav li.active a i {
    color: #ffffff;
}

.sidebar-nav i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 16px;
}

.sidebar-logout-form {
    margin: 0;
}

/* User profile area at bottom of sidebar */
.sidebar-user-area {
    border-top: 1px solid var(--border-color);
    padding: 16px;
}

.sidebar-user-area .dropdown-toggle::after {
    color: var(--text-secondary);
}

.sidebar-user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--primary-light);
    border: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-user-btn:hover {
    background: rgba(67, 97, 238, 0.14);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex-grow: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top Navbar */
.top-navbar {
    height: var(--header-height);
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
}

.user-dropdown {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
}

.user-dropdown i {
    font-size: 1.2rem;
    color: var(--primary-color);
    vertical-align: middle;
}

/* Content Area */
.content-area {
    padding: 30px;
    flex-grow: 1;
}

/* Page Headers */
.page-header {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    padding-left: 10px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0;
    padding-left: 10px;
}

/* .page-header {
    background-color: var(--bg-surface, #ffffff);
    margin-bottom: 24px;
    padding: 20px;
    border-radius: 8px;
    
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
} */

/* ==========================================
   CARDS
   ========================================== */
.content-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
    background: #fff;
}

.content-card:hover {
    box-shadow: var(--card-hover-shadow);
}

.content-card .card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    background: white;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.stat-card-body {
    padding: 24px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 20px;
}

.stat-info {
    flex-grow: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.stat-card-success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card-danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card-info .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.stat-card-warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Domain Cards (Practice Index) */
.domain-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.domain-card:hover {
    transform: translateY(-5px);
}

.domain-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ==========================================
   QUIZ UI
   ========================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-text {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
}

#optionsContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    #optionsContainer {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.option-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.option-item:hover:not(.disabled) {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.option-item.selected {
    border-color: var(--primary-color);
    background-color: rgba(111, 66, 193, 0.05);
}

.option-item.correct {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.06);
}

.option-item.incorrect {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.06);
}

.option-item.disabled {
    cursor: default;
    opacity: 0.8;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.80rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background-color: var(--primary-color);
    color: white;
}

.option-item.correct .option-letter {
    background-color: #10b981;
    color: white;
}

.option-item.incorrect .option-letter {
    background-color: #ef4444;
    color: white;
}

.option-text {
    flex-grow: 1;
    font-size: 14px;
}

.option-indicator {
    width: 24px;
    display: flex;
    justify-content: flex-end;
    font-size: 1.25rem;
}

.option-item .option-indicator i {
    display: none;
}

.option-item.selected .option-indicator i {
    display: block;
    color: var(--primary-color);
}

.option-item.correct .option-indicator i {
    display: block;
}

.option-item.incorrect .option-indicator i {
    display: block;
}

.feedback-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.feedback-section .alert {
    font-size: 14px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

/* Quiz Complete UI */
.quiz-complete-container {
    max-width: 600px;
    margin: 0 auto;
}

.result-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto;
}

.result-pass {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.result-fail {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.result-stat {
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
}

.result-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.result-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    padding: 40px 0;
    background: #202c36 !important;
}

.footer-links {
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li a {
    color: #fff;
    text-decoration: none;
}

.footer-links li a:hover {
    text-decoration: underline;
}

.footer-contact {
    margin-bottom: 10px;
}

.footer-contact p {
    margin-bottom: 10px;
}

.footer-contact p strong {
    color: #fff;
}

.footer-tag {
    font-size: 13px;
}

.footer-tag a {
    text-decoration: none;
}

.footer-tag a:hover {
    text-decoration: underline;
}


/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .content-area {
        padding: 20px;
    }
}

.form-label,
.form-check-label {
    font-size: 14px;
    font-weight: 400;
}

.form-control,
.form-select {
    font-size: 14px;
}

.pagination .page-item.active .page-link {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}