/* Biosfera Research Institute - Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Active navigation state */
.nav-link.active {
    color: #2D8A8A;
    background-color: rgba(45, 138, 138, 0.1);
    font-weight: 500;
}

/* Mobile navigation active state */
@media (max-width: 1023px) {
    .nav-link.active {
        background-color: transparent;
        border-left: 3px solid #2D8A8A;
        padding-left: calc(0.5rem - 3px);
    }
}

/* Mesh background pattern for hero */
.mesh-background {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, #2D8A8A 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, #5BA4C9 1px, transparent 1px);
    background-size: 60px 60px;
    animation: mesh-drift 20s ease-in-out infinite;
}

@keyframes mesh-drift {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-10px, -10px);
    }
}

/* Section scroll margins for fixed navigation */
section[id] {
    scroll-margin-top: 80px;
}

@media (min-width: 1024px) {
    section[id] {
        scroll-margin-top: 20px;
    }
}

/* Scroll indicator bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%) translateX(-50%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0) translateX(-50%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Hide scroll indicator after scrolling */
.scrolled .animate-bounce {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile menu animation */
#mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

#mobile-nav.show {
    max-height: 500px;
    display: block;
}

/* Sidebar shadow */
aside {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* Team card expandable styles */
.team-card {
    transition: all 0.3s ease;
}

.team-card-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 2rem;
}

.team-card.expanded .team-card-expanded {
    display: block;
    max-height: 600px;
    padding: 2rem;
}

.team-card.expanded {
    border-color: rgba(45, 138, 138, 0.3);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Rotate chevron when expanded */
.team-card .expand-icon {
    transition: transform 0.3s ease;
}

.team-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2D8A8A;
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background-color: rgba(45, 138, 138, 0.2);
    color: #2D3436;
}

/* Print styles */
@media print {
    aside,
    header {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }

    section {
        page-break-inside: avoid;
    }

    .team-card-expanded {
        display: block !important;
        max-height: none !important;
        padding: 2rem !important;
    }

    .animate-bounce {
        display: none;
    }
}

/* Initiative card anchor offset */
#soiltech,
#3d-reconstruction,
#ai-quantification {
    scroll-margin-top: 100px;
}

@media (min-width: 1024px) {
    #soiltech,
    #3d-reconstruction,
    #ai-quantification {
        scroll-margin-top: 40px;
    }
}

/* Loading state for images */
img {
    background-color: rgba(45, 138, 138, 0.05);
}

/* Transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Card hover effects */
.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
