/* Projects Page Styles - Lightweight & Optimized */

/* Projects Grid - clean responsive layout, no weird gaps */
#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: flex-start;
}

/* Project Card Animations */
.project-card {
    position: relative;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    height: auto;
    display: block;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(147, 51, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 1.5rem;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Description Expand/Collapse - Fixed height for consistency */
.project-description {
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.project-description.expanded {
    max-height: 1000px;
}

/* See More Button Animation */
.see-more-btn {
    transition: all 0.3s ease;
}

.see-more-btn:hover {
    transform: translateX(4px);
}

.see-more-btn i {
    transition: transform 0.3s ease;
}

.see-more-btn.expanded i {
    transform: rotate(180deg);
}

/* File Item Hover Effects */
.file-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-item:hover {
    transform: translateX(4px);
}

/* Gradient Text Utilities */
.gradient-text-pink {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-blue {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Modal Animations */
.modal-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton Loading (Optional) */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Image Optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Custom Scrollbar for Modal */
#all-files-content::-webkit-scrollbar {
    width: 8px;
}

#all-files-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

#all-files-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-radius: 4px;
}

#all-files-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #db2777, #7c3aed);
}

/* Pulse Animation for Hero Icons */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce Animation Delay */
.animate-bounce-delayed {
    animation: bounce 1s infinite;
    animation-delay: 0.5s;
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .project-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    button,
    .see-more-btn {
        display: none;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .project-card {
        margin-bottom: 1.5rem;
    }

    /* Optimize hover effects for touch devices */
    @media (hover: none) {
        .project-card:hover {
            transform: none;
        }

        .project-card:active {
            transform: scale(0.98);
        }
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark Mode Support (Optional - if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Lazy Load Images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Search Filter Styles */
#project-search {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#project-search:focus {
    box-shadow: 0 20px 25px -5px rgba(236, 72, 153, 0.1), 0 10px 10px -5px rgba(236, 72, 153, 0.04);
}

#search-results-count {
    transition: all 0.3s ease;
}

/* No Results Message */
#no-results {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#no-results:not(.hidden) {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Card Filter Animations */
.project-card {
    transition: opacity 0.3s ease, transform 0.3s ease, display 0.3s allow-discrete;
}
