/* Wallinhub Custom Styles - Minimalist Gray Theme */

/* PSY1010 Navigation System - Enhanced */
.psy1010-navigation-pane {
    position: fixed;
    top: 60px; /* Below the main site navigation */
    right: 0;
    width: 350px;
    height: calc(100vh - 60px);
    background: white;
    border-left: 1px solid #e1e5e9;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 999; /* Below main site nav but above content */
    overflow: hidden;
    transform: translateX(350px);
    transition: transform 0.3s ease-in-out;
}

.psy1010-navigation-pane:not(.collapsed) {
    transform: translateX(0);
}

.psy1010-nav-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}


/* Hide toggle button when nav is open - use close button instead */
.psy1010-navigation-pane:not(.collapsed) ~ .psy1010-nav-toggle,
.psy1010-nav-toggle.nav-open {
    display: none;
}

/* Search section styles */
.psy1010-nav-search {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.psy1010-nav-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.psy1010-nav-search input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.psy1010-nav-search button {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    float: right;
}

.psy1010-nav-search button:hover {
    background: #5a6268;
}

.psy1010-nav-header {
    background: #f8f9fa;
    border-bottom: 2px solid #007bff;
    color: #343a40;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.psy1010-nav-header h4 {
    margin: 0;
    font-size: 16px;
    color: #007bff;
    letter-spacing: 0.5px;
}

.psy1010-nav-actions {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.psy1010-nav-quiz-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.psy1010-nav-quiz-link:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Quiz builder collapsible chapters */
.chapter-toggle-icon {
    font-size: 0.8em;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 12px;
}

.btn[data-bs-toggle="collapse"]:hover .chapter-toggle-icon {
    color: #0056b3;
}

.quiz-builder .btn-link {
    color: inherit !important;
}

.quiz-builder .btn-link:hover {
    color: #0056b3 !important;
}

.psy1010-nav-close {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
}

.psy1010-nav-close:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.psy1010-nav-body {
    padding: 20px;
    height: calc(100% - 60px);
    overflow-y: auto;
    background: #fafafa;
}

.psy1010-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
}

.psy1010-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.psy1010-search-results {
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-bottom: 15px;
}

.psy1010-search-results.show {
    display: block;
}

.psy1010-search-result {
    padding: 8px;
    margin: 4px 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.psy1010-search-result:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.psy1010-chapter-link {
    display: block;
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.psy1010-chapter-link:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
}

/* PSY1010 Content Styles */
.psy1010-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    margin-right: 370px;
}

.psy1010-highlight-selected {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Navigation Toggle Button with integrated search hint */
.psy1010-nav-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: rgba(33, 110, 243, 0.9); /* Blue background to distinguish from main nav */
    color: white; /* White text for contrast */
    border: 1px solid rgba(33, 110, 243, 0.8);
    border-radius: 20px; /* More rounded to distinguish from main nav */
    box-shadow: 0 3px 8px rgba(33, 110, 243, 0.3); /* Blue shadow */
    transition: all 0.3s ease;
    z-index: 1000;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.psy1010-nav-toggle:hover {
    background-color: rgba(33, 110, 243, 1); /* Darker blue on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 110, 243, 0.4);
}

.psy1010-nav-toggle-icon {
    font-size: 1.2em;
    color: white; /* White icon for blue background */
}

.psy1010-nav-toggle-hint {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.9); /* Light white for hint text */
    white-space: nowrap;
}

.psy1010-nav-toggle-hint strong {
    color: #495057;
    background-color: rgba(255, 255, 255, 0.9); /* Light background for key hint */
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    font-family: monospace;
    margin: 0 2px;
}

/* Hide hint when navigation is open */
.psy1010-nav-toggle.nav-open .psy1010-nav-toggle-hint {
    display: none;
}


/* Search Results Styles */
.psy1010-search-results {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background-color: white;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.psy1010-search-results.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.psy1010-search-result-item {
    padding: 12px;
    margin: 4px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.psy1010-search-result-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.psy1010-search-result-item.selected {
    background: #e7f3ff;
    border-color: #007bff;
    position: relative;
}

.psy1010-search-result-item.selected::before {
    content: "→";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bff;
    font-weight: bold;
}

.psy1010-search-result-context {
    font-size: 14px;
    color: #495057;
    margin-bottom: 4px;
    line-height: 1.4;
}

.psy1010-search-result-title {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

/* Search mode optimizations - full height expansion */
.psy1010-nav-content.search-mode .psy1010-search-results {
    margin-bottom: 0;
    flex: 1;
    height: calc(100vh - 140px); /* Full height minus header and search input */
    min-height: 400px;
    max-height: none;
}

.psy1010-nav-content.search-mode .psy1010-nav-divider,
.psy1010-nav-content.search-mode .psy1010-nav-body {
    display: none;
}

/* Chapter Navigation Styles */
.psy1010-nav-chapter {
    margin-bottom: 8px;
}

.psy1010-nav-chapter-title {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.psy1010-nav-chapter-text {
    flex: 1;
    margin-left: 8px;
}

.psy1010-nav-chapter-title:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.psy1010-nav-arrow {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.2s ease;
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
}

.psy1010-nav-arrow:hover {
    background: #dee2e6;
    color: #495057;
}

.psy1010-nav-chapter.expanded .psy1010-nav-arrow {
    transform: rotate(90deg);
}

/* Sticky chapter title when expanded */
.psy1010-nav-chapter.expanded .psy1010-nav-chapter-title {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 2px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.psy1010-nav-sections {
    display: none;
    padding-left: 16px;
    padding-top: 8px;
}

.psy1010-nav-chapter.expanded .psy1010-nav-sections {
    display: block;
}

.psy1010-nav-section {
    padding: 10px 16px;
    margin: 3px 0;
    background: white;
    border: 1px solid #e9ecef;
    border-left: 3px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.psy1010-nav-section:hover {
    background: #f8f9fa;
    border-color: #007bff;
    border-left-color: #007bff;
}

.psy1010-nav-section.active {
    background: #e7f3ff;
    border-color: #007bff;
    border-left-color: #007bff;
    color: #007bff;
    font-weight: 500;
}

/* Collapsible heading styles */
.psy1010-nav-section-group {
    margin-bottom: 4px;
}

.psy1010-nav-h2 {
    font-weight: 500;
    background: #f8f9fa;
    position: relative;
    padding-left: 24px;
}

.psy1010-nav-section-arrow {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-size: 10px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.psy1010-nav-subsections {
    padding-left: 12px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.psy1010-nav-subsections.collapsed {
    max-height: 0;
}

.psy1010-nav-subsection {
    padding: 4px 12px;
    margin: 2px 0;
    margin-left: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.psy1010-nav-subsection:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.psy1010-nav-subsection.active {
    background: #e7f3ff;
    border-color: #007bff;
    color: #007bff;
    font-weight: 500;
}

.psy1010-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Force full-width layout on mobile by overriding Bootstrap containers */
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    * {
        box-sizing: border-box !important;
    }
    
    .container, .container-fluid {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .navbar {
        position: sticky !important; /* Ensure sticky positioning on mobile */
        top: 0 !important;
        z-index: 1000 !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .navbar .container {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding-left: 15px !important; /* Minimal padding for navbar content */
        padding-right: 15px !important; /* Same padding as left side */
    }
    
    .psy1010-navigation-pane {
        width: 100vw;
        left: 0;
        right: auto; /* Override desktop right: 0 */
        transform: translateX(-100%); /* Hide completely to the left */
    }
    
    .psy1010-navigation-pane:not(.collapsed) {
        transform: translateX(0);
    }
    
    .psy1010-content {
        margin: 0 !important; /* Remove all margins */
        max-width: none !important; /* Use full width on mobile */
        width: 100% !important; /* Force full width */
        padding: 15px !important; /* Only internal padding */
        box-sizing: border-box !important;
    }
    
    .psy1010-nav-toggle {
        right: 5px; /* Very close to screen edge */
        top: 70px; /* Just below main nav */
        padding: 6px 8px; /* More compact */
        font-size: 0.9em;
    }
    
    .psy1010-nav-toggle-hint {
        display: none !important; /* Always hide hint text on mobile */
    }
    
    .psy1010-nav-toggle-icon {
        font-size: 1.1em;
    }
}

/* Base layout and typography */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #343a40;
}

/* Desktop title spacing */
@media (min-width: 769px) {
    .main-content .row:first-child {
        margin-bottom: 1.5rem;
    }
}

/* Mobile improvements for task management */
@media (max-width: 768px) {
    /* Better title spacing on mobile */
    .main-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0;
        padding-left: 16px;
        padding-right: 8px;
        padding-top: 8px;
    }
    
    /* Improved collapse toggle button */
    .collapse-toggle-text {
        font-size: 1.2em;
        font-weight: bold;
        line-height: 1;
        display: inline-block;
        width: 20px;
        text-align: center;
    }
    
    /* Additional mobile spacing */
    .container.main-content {
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 20px;
    }
    
    /* Mobile title container adjustments */
    .main-content .row:first-child {
        margin-bottom: 0.25rem;
    }
    
    .main-content .row:first-child .col-12 > div {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 0;
    }
}

/* Sticky Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2rem;
    font-weight: 400;
    color: #343a40;
}

h5 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #343a40;
}

.text-muted {
    color: #6c757d !important;
}

/* Navigation styles */
.navbar {
    background-color: white !important;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    color: #343a40 !important;
    font-weight: 500;
}

.navbar-nav .nav-link {
    color: #6c757d !important;
    font-weight: 400;
}

.navbar-nav .nav-link:hover {
    color: #343a40 !important;
}

/* Content and cards */
.main-content {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.card {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    background: white;
}

.card-title {
    margin-bottom: 0.5rem !important;
    color: #343a40;
}

/* Button styles - Minimalist gray theme */
.btn-primary {
    background-color: #495057;
    border-color: #495057;
    color: white;
}

.btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
    color: white;
}

.btn-outline-primary {
    color: #495057;
    border-color: #495057;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #495057;
    border-color: #495057;
    color: white;
}

/* Form elements */
.form-label {
    color: #495057;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1px solid #dee2e6;
    color: #495057;
}

.form-control:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
    color: #495057;
}

.form-check-label {
    color: #6c757d;
}

.text-danger {
    color: #6c757d !important;
}

/* Links */
a {
    color: #495057;
    text-decoration: none;
}

a:hover {
    color: #343a40;
    text-decoration: underline;
}

/* Alerts */
.alert-success {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.alert-danger {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.alert-info {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

/* Landing page styles */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.landing-title {
    font-size: 4rem;
    font-weight: 200;
    color: #343a40;
    letter-spacing: -0.03em;
}


.login-link {
    font-size: 1.1rem;
    font-weight: 400;
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-link:hover {
    color: #343a40;
    text-decoration: underline;
}

/* PSY1010 Extension Styles */
.content-block span.page-marker,
span.page-marker {
    background-color: #495057 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

/* PSY1010 Content Type Specific Styles - Custom Classes */
.psy-chapter-contents {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.psy-chapter-contents h5 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 15px;
}

.psy-outcomes-box {
    background-color: #e7f3ff;
    border-left: 4px solid #0066cc;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.psy-definitions {
    background-color: #f5f5f5;
    border: 2px solid #0066cc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    color: #0066cc;
    font-weight: bold;
}

.psy-feature-box {
    background-color: #f5f0e8;
    border: 2px solid #8b4513;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.psy-feature-box .feature-header {
    border-bottom: 2px solid #8b4513;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: bold;
}

.psy-main-content {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.psy-chapter-review {
    background-color: #f8f9fa;
    border: 1px solid #6c757d;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.psy-chapter-review h5 {
    color: #495057;
    margin-bottom: 15px;
}

.psy-quiz {
    background-color: #cce5ff;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.psy-quiz h5 {
    color: #007bff;
    margin-bottom: 15px;
}

.psy-answer-key {
    background-color: #d1ecf1;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.psy-answer-key h5 {
    color: #28a745;
    margin-bottom: 15px;
}

.content-block.chapter-contents h5 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 15px;
}

.content-block.chapter-contents ul {
    list-style-type: disc;
    margin-left: 1.5rem;
}

.content-block.outcomes-box {
    background-color: #e7f3ff !important;
    border-left: 4px solid #0066cc !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    border-radius: 4px !important;
}

.content-block.definitions {
    background-color: #f5f5f5 !important;
    border: 2px solid #0066cc !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.content-block.definitions .definition-item {
    margin-bottom: 0.75rem;
}

.content-block.feature-box {
    background-color: #f5f0e8 !important;
    border: 2px solid #8b4513 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    position: relative;
}

.content-block.feature-box .feature-header {
    background: #8b4513 !important;
    color: white !important;
    padding: 8px 15px !important;
    margin: -20px -20px 15px -20px !important;
    border-radius: 6px 6px 0 0 !important;
    font-weight: bold !important;
}

.content-block.main-content {
    background: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05) !important;
}

.content-block.chapter-review {
    background-color: #f8f9fa;
    border: 1px solid #6c757d;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.content-block.chapter-review h5 {
    color: #495057;
    margin-bottom: 15px;
}

.content-block.quiz {
    background-color: #cce5ff;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.content-block.quiz h5 {
    color: #007bff;
    margin-bottom: 15px;
}

.content-block.answer-key {
    background-color: #d1ecf1;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.content-block.answer-key h5 {
    color: #28a745;
    margin-bottom: 15px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .landing-title {
        font-size: 2.5rem;
    }
    
    /* Reduce Halloween animation on mobile for performance */
    .trick-or-treater {
        opacity: 0.1;
    }
    
    .autumn-leaf {
        opacity: 0.05;
    }
    
    /* Hide some leaves on mobile */
    .autumn-leaf:nth-child(n+6) {
        display: none;
    }
}