/* Projects Layout CSS - Shared across all project category pages */
/* Fixed Side Panel Layout for Primary, Elementary, Intermediate, and Senior Projects */

/* Fixed Side Panel Layout */
.page-layout {
    display: flex;
    min-height: calc(100vh - 85px); /* Account for more compact navbar + breadcrumb */
    background: var(--background-light);
}

/* Page wrapper to contain everything after navbar */
body {
    margin: 0;
    padding: 0;
}

/* Fixed Left Side Panel - Filters */
.filter-panel {
    position: fixed;
    left: 0;
    top: 120px; /* Adjust for more compact navbar + breadcrumb height */
    width: 280px;
    height: calc(100vh - 120px);
    background: var(--white);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 50;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

/* Panel Header */
.panel-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.panel-header h2 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.panel-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

/* Panel Content */
.panel-content {
    padding: 1rem;
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    margin-left: 280px;
    padding: 1.5rem;
    max-width: calc(100vw - 280px);
    margin-top: 0; /* No extra margin needed as navbar is sticky */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 85px);
}

/* Search Box */
.search-container {
    margin-bottom: 1.25rem;
}

.search-box {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
    background: var(--white);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.75rem;
}

.filter-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-section h3 {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filter-section h3::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 1px;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.filter-option:hover {
    background: var(--background-light);
    border-color: #e9ecef;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary-color);
}

.filter-option label {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-dark);
    flex: 1;
    line-height: 1.1;
    font-weight: 400;
}

.filter-option:has(input:checked) {
    background: rgba(44, 90, 160, 0.1);
    border-color: var(--primary-color);
}

.filter-option:has(input:checked) label {
    color: var(--primary-color);
    font-weight: 500;
}

/* Action Buttons */
.panel-actions {
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    position: sticky;
    bottom: 0;
}

.clear-filters {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-filters:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.75rem;
    padding: 0.4rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(44, 90, 160, 0.1);
}

/* Main Content */
.content-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex: 1;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.results-count {
    color: #666;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.project-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary-color, #2c5aa0);
}

.project-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.project-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.project-item-link:hover {
    text-decoration: none;
    color: inherit;
}

.project-item-link:hover .project-item {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.project-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--primary-color, #2c5aa0);
}

.project-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.6rem;
}

.project-description {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

.subject-tag {
    background: var(--accent-color, #34c759);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.difficulty-tag {
    background: var(--secondary-color, #ff6b35);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    position: fixed;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    display: none; /* Hidden by default, shown only on mobile */
}

/* States for different status */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .filter-panel {
        width: 260px;
    }
    
    .main-content-area {
        margin-left: 260px;
        max-width: calc(100vw - 260px);
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .filter-panel {
        top: 75px; /* Adjust for more compact mobile navbar + breadcrumb height */
        height: calc(100vh - 75px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 99; /* Higher z-index for mobile overlay */
    }
    
    .filter-panel.mobile-open {
        transform: translateX(0);
    }
    
    /* Mobile overlay when panel is open */
    .filter-panel.mobile-open::after {
        content: '';
        position: fixed;
        top: 75px;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 98;
    }
    
    .main-content-area {
        margin-left: 0;
        max-width: 100vw;
        padding: 0.75rem;
    }
    
    .mobile-filter-toggle {
        display: flex; /* Show on mobile */
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

@media (min-width: 769px) {
    .mobile-filter-toggle {
        display: none;
    }
}

/* =============================================================================
   SECTION FOOTER - FIXED BOTTOM
   ============================================================================= */

/* Fixed Section Footer for Project Pages */
.section-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 45px; /* Compact single line footer */
    background: var(--white);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 60; /* Higher than filter panel */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* When disclaimer is expanded */
.section-footer.disclaimer-open {
    min-height: 115px; /* Smaller expansion for simplified footer */
}

/* Footer Legal Information Bar - Now the main and only content */
.footer-legal {
    background: var(--white);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-left: 280px; /* Account for fixed sidebar */
    flex: 1;
}

.legal-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.copyright {
    color: #666;
    font-weight: 500;
}

.legal-separator {
    color: #ccc;
}

.legal-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.legal-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Disclaimer Toggle Button */
.disclaimer-toggle {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

.disclaimer-toggle:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

.disclaimer-icon {
    font-size: 0.8rem;
}

/* Footer Disclaimer Section */
.footer-disclaimer {
    background: #fff3cd;
    border-top: 1px solid #ffeaa7;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-left: 280px; /* Account for fixed sidebar */
}

.footer-disclaimer.expanded {
    max-height: 80px;
    padding: 0.75rem 1rem;
}

.disclaimer-content {
    font-size: 0.65rem;
    color: #856404;
    line-height: 1.4;
}

.disclaimer-content strong {
    color: #533f03;
}



/* Scroll Progress Indicator */
.scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.1s ease;
    z-index: 1;
}

/* Adjust main content area to account for fixed footer */
.main-content-area {
    padding-bottom: 65px; /* Account for compact footer height + some spacing */
    margin-bottom: 0;
}

/* Adjust page layout for fixed footer */
.page-layout {
    min-height: calc(100vh - 85px - 45px); /* Account for navbar + footer */
}

/* Adjust filter panel for fixed footer */
.filter-panel {
    height: calc(100vh - 120px - 45px); /* Account for navbar + footer */
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
    .footer-legal {
        margin-left: 260px;
        font-size: 0.7rem;
    }
    
    .footer-disclaimer {
        margin-left: 260px;
    }
}

@media (max-width: 768px) {
    .section-footer {
        min-height: 50px; /* Compact mobile footer */
    }
    
    .section-footer.disclaimer-open {
        min-height: 120px; /* Smaller expansion on mobile */
    }
    
    .footer-legal {
        margin-left: 0;
        padding: 0.6rem 0.75rem;
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
        font-size: 0.65rem;
    }
    
    .footer-disclaimer {
        margin-left: 0;
    }
    
    .footer-disclaimer.expanded {
        max-height: 70px; /* Smaller on mobile */
    }
    
    .disclaimer-toggle {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Adjust content area for mobile footer */
    .main-content-area {
        padding-bottom: 70px; /* Adjust for mobile footer */
    }
    
    /* Adjust filter panel for mobile footer */
    .filter-panel {
        height: calc(100vh - 75px - 50px); /* Account for mobile navbar + footer */
    }
}

@media (max-width: 480px) {
    .legal-text {
        flex-direction: column;
        gap: 0.2rem;
        font-size: 0.6rem;
    }
    
    .legal-separator {
        display: none; /* Hide separators on very small screens */
    }
    
    .disclaimer-content {
        font-size: 0.6rem;
    }
}

/* =============================================================================
   SAFETY NOTICE SECTION
   ============================================================================= */

/* Safety Notice for Project Pages */
.safety-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.safety-notice h4 {
    color: #856404;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.safety-notice p {
    color: #856404;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.3;
}

/* Mobile responsive adjustments for safety notice */
@media (max-width: 768px) {
    .safety-notice {
        padding: 0.6rem;
        margin-bottom: 0.75rem;
    }
    
    .safety-notice h4 {
        font-size: 0.85rem;
    }
    
    .safety-notice p {
        font-size: 0.8rem;
    }
}

/* Projects Directory Specific Styles */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: var(--white);
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: white !important;
}

.hero-section p {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.4;
    color: white !important;
}

/* Featured Projects Layout */
.featured-projects {
    margin-bottom: 3rem;
}

.featured-project {
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.featured-project:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.featured-project h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.featured-project p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
}

.featured-project img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.featured-project img:hover {
    transform: scale(1.02);
}

.featured-project a {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.featured-project a:hover {
    background: #1e3a5f;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(44, 90, 160, 0.4);
}

/* Grade Level Navigation Cards */
.content-container a[href*="projects.php"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.content-container a[href*="projects.php"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.content-container a[href*="projects.php"] h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.content-container a[href*="projects.php"] p {
    opacity: 0.9;
    font-size: 1rem;
    margin: 0;
}

/* Enhanced project item styling for directory */
.project-item {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.project-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.subject-tag, .grade-tag {
    background: rgba(255,255,255,0.95);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(44, 90, 160, 0.2);
}

.project-description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

/* Mobile responsiveness for projects directory */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .featured-project {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
    }
    
    .featured-project img {
        order: -1;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .featured-project h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .featured-project {
        padding: 1.5rem;
    }
    
    .featured-project h3 {
        font-size: 1.25rem;
    }
}

/* Scroll to Top Button Styles */
.scroll-to-top {
    position: fixed;
    bottom: 100px; /* Position above section footer */
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
    transition: all 0.3s ease;
    z-index: 55; /* Above section footer but below mobile filters */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.scroll-to-top:hover {
    background: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(44, 90, 160, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Mobile adjustments for scroll to top button */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 90px; /* Adjust for mobile footer height */
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}