/* Modern CSS for FreeScienceProject.com */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5aa0;
    --secondary-color: #ff6b35;
    --accent-color: #34c759;
    --text-dark: #1d1d1f;
    --text-light: #86868b;
    --background-light: #f5f5f7;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--primary-color);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--primary-color);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 2rem);
}

p {
    margin-bottom: 1em;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.logo img {
    height: auto;
    max-width: 200px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
}

.nav-links a:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

/* Cards and Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Grade levels grid - force 4 columns on desktop */
.grade-levels .projects-grid {
    grid-template-columns: repeat(4, 1fr);
}

.project-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.grade-badge {
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.difficulty-badge {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #1e3a5f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.featured-projects {
    background: var(--white);
    padding: 4rem 0;
}

.grade-levels {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
}

.grade-level-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.grade-level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.grade-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #1e3a5f);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.grade-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: var(--transition);
}

.grade-level-card:hover .grade-icon::after {
    animation: shine 1s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Grade level specific content */
.grade-icon.primary {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

.grade-icon.primary::before {
    content: 'K-4';
}

.grade-icon.elementary {
    background: linear-gradient(135deg, var(--primary-color), #1e3a5f);
}

.grade-icon.elementary::before {
    content: '4-6';
}

.grade-icon.intermediate {
    background: linear-gradient(135deg, var(--secondary-color), #e55a2b);
}

.grade-icon.intermediate::before {
    content: '7-8';
}

.grade-icon.senior {
    background: linear-gradient(135deg, #9C27B0, #6A1B9A);
}

.grade-icon.senior::before {
    content: '9-12';
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #ccc;
}

.footer-bottom a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--white);
}

/* Schema.org structured data styling */
.breadcrumb {
    background: var(--white);
    padding: 0.25rem 0 0.6rem 0;
    font-size: 0.85rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.6rem 0;
    }
    
    .logo img {
        max-width: 150px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .project-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Search and filter components */
.search-container {
    background: var(--white);
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.filter-tab:hover,
.filter-tab.active {
    background: var(--primary-color);
    color: var(--white);
}

/* FAQ Section */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.faq-question {
    background: var(--background-light);
    padding: 1.5rem;
    margin: 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 1.5rem;
    display: none;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Kit availability badge */
.kit-available {
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Section subtitle */
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero buttons */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Disclaimer styling */
.disclaimer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
}

/* Related topics and educational context */
.related-topics,
.educational-context,
.practical-applications {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.related-topics h3,
.educational-context h3,
.practical-applications h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.related-topics ul,
.practical-applications ul {
    list-style: none;
    padding: 0;
}

.related-topics li,
.practical-applications li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.related-topics li:last-child,
.practical-applications li:last-child {
    border-bottom: none;
}

/* Social links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Voice search optimization (hidden) */
.voice-search-optimization,
.local-voice-optimization {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background: #1e3a5f;
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.scroll-to-top.visible {
    opacity: 0.8;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top.visible:hover {
    opacity: 1;
}

.scroll-to-top svg {
    transition: transform 0.2s ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

/* Conversational intro */
.conversational-intro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    color: var(--text-dark);
}

/* Project pages styling */
.project-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.project-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3a5f 100%);
    color: white;
    border-radius: 12px;
}

.project-header h1 {
    color: white;
    margin-bottom: 1rem;
}

.project-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--background-light);
    border-radius: 8px;
}

.project-nav-links {
    display: flex;
    gap: 1rem;
}

.project-nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
}

.project-nav-links a:hover {
    background: var(--primary-color);
    color: white;
}

.project-main {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.related-projects {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.related-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.safety-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.safety-notice h4 {
    color: #856404;
    margin-bottom: 1rem;
}

.safety-notice p {
    color: #856404;
    margin: 0;
}

.subject-badge {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Enhanced responsive design */
@media (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    /* Grade levels responsive - 2 columns on tablets */
    .grade-levels .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .project-nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-tabs {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 1rem;
    }
    
    /* Grade levels responsive - single column on mobile */
    .grade-levels .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* =============================================================================
   SECTION FOOTER - FIXED BOTTOM GLOBAL STYLES
   Additional styles for the fixed footer used in project pages
   ============================================================================= */

/* Global Section Footer Base Styles */
.section-footer {
    font-family: inherit;
}

/* Ensure the footer links match the site design */
.section-footer .footer-nav-link {
    font-family: inherit;
    transition: var(--transition);
}

.section-footer .footer-nav-link:hover {
    text-decoration: none;
}

/* Ensure scroll progress uses site accent color */
.section-footer .scroll-progress {
    background: var(--accent-color);
}

/* Make sure footer colors use the site palette */
.section-footer .footer-brand {
    color: var(--primary-color);
}

.section-footer .stats-number {
    color: var(--primary-color);
}

/* Adjust z-index to work with existing site components */
.section-footer {
    z-index: 60;
}