/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    background: #ffffff;
}

/* Header/Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
}

.logo {
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.logo-subtitle {
    font-size: 12px;
    color: #666;
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-wrapper {
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    color: #1a1a1a;
    transition: all 0.2s;
}

.search-bar:focus {
    outline: none;
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.search-result-path {
    font-size: 12px;
    color: #666;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-content {
    padding: 20px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.nav-section-title:hover {
    background: #e8e8e8;
    color: #333;
}

.section-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #999;
}

.nav-section-items {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.nav-section:not(.expanded) .nav-section-items {
    max-height: 0;
    opacity: 0;
}

/* Additional styling for collapsed sections */
.nav-section {
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.nav-section.expanded {
    background: rgba(37, 99, 235, 0.02);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

.nav-section.expanded .nav-section-title {
    color: #2563eb;
    font-weight: 700;
}

.nav-section.expanded .section-arrow {
    color: #2563eb;
}

/* Smooth animation for arrow rotation */
.nav-section.expanded .section-arrow {
    transform: rotate(0deg);
}

.nav-section:not(.expanded) .section-arrow {
    transform: rotate(-90deg);
}

/* Improve spacing for nav items in expanded sections */
.nav-section.expanded .nav-section-items {
    padding-top: 4px;
    padding-bottom: 8px;
}

/* Add subtle separator between sections */
.nav-section + .nav-section {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: #e8e8e8;
}

.nav-item.active {
    background: #2563eb;
    color: white;
}

.nav-item i {
    width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 60px;
    background: #ffffff;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 16px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
}

h2 {
    font-size: 2rem;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

h3 {
    font-size: 1.5rem;
    margin-top: 32px;
}

p {
    margin-bottom: 16px;
    color: #333;
    line-height: 1.7;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: #f3f4f6;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert h4 {
    margin-bottom: 8px;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid #2196f3;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid #4caf50;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

/* Code Blocks */
.code-block {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #e0e0e0;
    color: #1a1a1a;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #1a1a1a;
}

/* Links */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
    color: #333;
}

/* Form Elements */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    color: #1a1a1a;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1a1a1a;
}

/* Checkboxes and Radio */
input[type="checkbox"],
input[type="radio"] {
    margin-right: 8px;
}

/* Question Cards for Exams */
.question-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.options label {
    display: block;
    padding: 10px 16px;
    margin: 8px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.options label:hover {
    background: #f0f0f0;
    border-color: #2563eb;
}

.options input[type="radio"] {
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .main-content {
        margin-left: 0;
    }

    .search-container {
        display: none;
    }

    .content-wrapper {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile-specific collapsible menu styles */
    .nav-section-title {
        font-size: 12px;
        padding: 10px 12px;
    }

    .nav-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .section-arrow {
        font-size: 14px;
    }
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Improve readability */
.main-content p,
.main-content li {
    font-size: 16px;
    line-height: 1.8;
}

/* Make sure all text is visible */
* {
    color: inherit;
}

/* Ensure proper contrast */
.nav-item.active {
    background: #2563eb;
    color: white !important;
}

.nav-item.active i {
    color: white !important;
} 