/* Layout Styles */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-layout {
    display: flex;
    margin-top: 56px; /* Height of navbar */
    min-height: calc(100vh - 56px);
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    border-right: 1px solid #dee2e6;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1020;
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar .nav {
    padding: 0 1rem;
}

.sidebar .nav-section-header {
    padding: 1rem 1rem 0.5rem 1rem;
    margin-top: 1rem;
}

.sidebar .nav-section-header:first-child {
    margin-top: 0;
}

.sidebar .nav-section-header span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    padding-left: 0.5rem;
}

.sidebar .nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar .nav-link i {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    transition: margin-left 0.3s ease-in-out;
}

.content-wrapper {
    padding: 2rem;
    max-width: 100%;
}

/* Footer */
.app-footer {
    padding: 1rem 0;
    margin-top: auto;
    background-color: #f8f9fa;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
}

/* Navbar Customization */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

/* Pre-login landing (matches docs/mockups/student/pre-login-landing.html) */
.hero-section {
    background: #f8f9fa;
    padding: 60px 0;
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    color: #007bff;
}

/* Page Content Styles */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #dc3545;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* Form Styles */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Alert Styles */
.alert {
    border-radius: 0.75rem;
    border: none;
}

/* Bootstrap Icons using emojis */
.bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -.125em;
    fill: currentcolor;
    font-style: normal;
}

.bi-house-door::before { content: "🏠"; }
.bi-question-circle::before { content: "❓"; }
.bi-diagram-3::before { content: "🗂️"; }
.bi-people::before { content: "👥"; }
.bi-shield-lock::before { content: "🔐"; }
.bi-gear::before { content: "⚙️"; }
.bi-bar-chart::before { content: "📊"; }
.bi-graph-up::before { content: "📈"; }

/* Mobile Styles */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .nav-link {
        padding: 12px 16px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .content-wrapper {
        padding: 1rem 0.75rem;
    }
    
    .form-control {
        font-size: 16px;
        min-height: 44px;
    }
    
    .form-select {
        font-size: 16px;
        min-height: 44px;
    }
    
    .sidebar {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Desktop: only add main-content margin when sidebar is fixed (Razor layout with sidebar). WASM uses flex, so no margin. */
@media (min-width: 992px) {
    .app-layout.layout-with-fixed-sidebar .main-content {
        margin-left: 280px;
    }
}