/* Performance Optimizations */

/* Lazy Loading Images */
img {
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

img:not(.loaded) {
    opacity: 0;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Caching Hints */
.hero::before {
    will-change: transform;
}

.feature-card {
    will-change: transform;
}

.team-member-card {
    will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Critical CSS Inlining */
.above-the-fold {
    contain: layout style paint;
}

/* Preload Important Resources */
:root {
    --preload-fonts: url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Grotesk:wght@300;400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
}

/* Performance Monitoring */
.performance-indicator {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.performance-indicator.show {
    opacity: 1;
}

/* Resource Hints */
.resource-hint {
    content-visibility: auto;
    contain-intrinsic-size: 800px 600px;
}

/* Search Functionality */
.search-container {
    position: relative;
}

.search-input {
    padding-right: 120px;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

/* Additional Custom Styles for ENMT Website */

/* Custom Loader Animation - Library Empowering Community */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a5f3f 0%, #2d8659 50%, #4a9d5f 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOut 0.5s ease-in-out 2.5s forwards;
}

.loader-content {
    text-align: center;
    color: white;
    max-width: 400px;
}

.loader-animation {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

.library-building {
    position: absolute;
    width: 60px;
    height: 80px;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px 5px 0 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.library-building::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 30px;
    left: 50%;
    top: -25px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50% 50% 0 0;
}

.library-door {
    position: absolute;
    width: 20px;
    height: 30px;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    background: #8b4513;
    border-radius: 10px 10px 0 0;
}

.knowledge-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.wave {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    left: 50%;
    top: 50%;
    transform: translateX(-50%);
    opacity: 0;
}

.wave-1 {
    animation: waveExpand 3s ease-in-out infinite 0s;
}

.wave-2 {
    animation: waveExpand 3s ease-in-out infinite 0.5s;
}

.wave-3 {
    animation: waveExpand 3s ease-in-out infinite 1s;
}

.community-people {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.person {
    position: absolute;
    width: 12px;
    height: 20px;
    background: #fff;
    border-radius: 50% 50% 0 0;
    bottom: 20px;
    opacity: 0.7;
}

.person-1 {
    left: 40px;
    animation: personRise 3s ease-in-out infinite 0.2s;
}

.person-2 {
    left: 100px;
    animation: personRise 3s ease-in-out infinite 0.7s;
}

.person-3 {
    left: 160px;
    animation: personRise 3s ease-in-out infinite 1.2s;
}

.book-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.book-icon {
    position: absolute;
    width: 8px;
    height: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    opacity: 0;
}

.book-1 {
    left: 60px;
    top: 60px;
    animation: bookFloat 3s ease-in-out infinite 0.3s;
}

.book-2 {
    left: 140px;
    top: 50px;
    animation: bookFloat 3s ease-in-out infinite 0.8s;
}

.book-3 {
    left: 100px;
    top: 70px;
    animation: bookFloat 3s ease-in-out infinite 1.3s;
}

.loader-text h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    animation: textGlow 2s ease-in-out infinite;
}

.loader-text p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
}

.loader-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f3f300, #000000);
    border-radius: 2px;
    animation: progressFill 3s ease-in-out forwards;
}

/* Loader Animations */
@keyframes waveExpand {
    0%, 100% { 
        opacity: 0;
        width: 60px;
        transform: translateX(-50%) translateY(-50%);
    }
    50% { 
        opacity: 1;
        width: 120px;
        transform: translateX(-50%) translateY(-50%);
    }
}

@keyframes personRise {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-15px) scale(1.1);
        opacity: 1;
    }
}

@keyframes bookFloat {
    0%, 100% { 
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    50% { 
        opacity: 1;
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes textGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Theme Transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light Theme Specific Styles */
[data-theme="light"] .image-gallery .gallery-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 170, 136, 0.2);
}

[data-theme="light"] .project-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 170, 136, 0.2);
}

[data-theme="light"] .team-member {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 170, 136, 0.2);
}

[data-theme="light"] .testimonial-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 170, 136, 0.2);
}

[data-theme="light"] .timeline-content {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 170, 136, 0.2);
}

[data-theme="light"] .progress-bar {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .lightbox {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 170, 136, 0.3);
    color: var(--light-text);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 170, 136, 0.2);
}

/* Image Gallery Styles */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.2);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 255, 204, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.gallery-overlay p {
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* Project Showcase Styles */
.project-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 255, 204, 0.2);
}

.project-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 2rem;
}

.project-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-2);
    color: var(--dark-bg);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--light-text);
}

.project-description {
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 255, 204, 0.1);
}

.project-stat {
    text-align: center;
}

.project-stat-number {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.project-stat-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Team Member Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.team-member {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 255, 204, 0.2);
}

.team-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--dark-bg);
}

.team-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

.team-role {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.team-bio {
    color: var(--gray-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Testimonial Styles */
.testimonial-section {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.05), rgba(0, 204, 255, 0.05));
    border-radius: 20px;
    margin: 3rem 0;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
}

.testimonial-quote {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--gray-text);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-weight: 600;
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}

.testimonial-location {
    color: var(--gray-text);
    font-size: 0.9rem;
}

/* Progress Bar Styles */
.progress-section {
    margin: 3rem 0;
}

.progress-item {
    margin-bottom: 2rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--gray-text);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-2);
    border-radius: 4px;
    transition: width 1s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-2);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-content {
    flex: 1;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 15px;
    margin: 0 2rem;
}

.timeline-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-2);
    color: var(--dark-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid var(--dark-bg);
    border-radius: 50%;
    z-index: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: column !important;
        padding-left: 50px;
    }
    
    .timeline-content {
        margin: 0;
    }
    
    .timeline-date,
    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }
    
    .project-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}
