/* Gallery Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.in-viewport {
    animation: fadeInUp 0.6s ease forwards;
}

/* Animation Delays */
.animation-delay-0-2s {
    animation-delay: 0.2s;
}

.animation-delay-0-4s {
    animation-delay: 0.4s;
}

.animation-delay-0-5s {
    animation-delay: 0.5s;
}

.animation-delay-1s {
    animation-delay: 1s;
}

.animation-delay-2s {
    animation-delay: 2s;
}

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

/* Performance optimizations */
.gallery-card {
    will-change: transform;
    backface-visibility: hidden;
}

/* Responsive optimizations */
@media (max-width: 640px) {
    .gallery-card {
        animation-duration: 0.4s;
    }
}

/* Hide scrollbar styles */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Premium Gallery Card Styles */
.gallery-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Forțează cardurile să aibă aceeași înălțime */
}

@media (max-width: 640px) {
    .gallery-cards-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .gallery-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .gallery-cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1281px) {
    .gallery-cards-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-card {
    position: relative;
    backdrop-filter: blur(20px);
    transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%; /* Forțează cardurile să aibă înălțimea completă */
}

.gallery-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-card-body {
    flex: 1; /* Permite conținutului să se întindă */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    min-height: 120px; /* Înălțime minimă pentru uniformitate */
}

.gallery-card-description {
    flex: 1; /* Permite descrierii să se întindă */
    margin-bottom: 1rem;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 1.5rem;
    opacity: 0;
    transition: opacity 0.7s ease;
    z-index: -2;
}

.gallery-card:hover::before {
    opacity: 1;
}

.gallery-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3B82F6, #10B981, #A855F7, #EF4444, #3B82F6);
    background-size: 400% 400%;
    border-radius: 1.5rem;
    opacity: 0;
    z-index: -1;
    animation: gradientShift 4s ease infinite;
    transition: opacity 0.7s ease;
}

.gallery-card:hover::after {
    opacity: 0.3;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating animation for play button */
@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes elegantPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px 10px rgba(255, 255, 255, 0.1);
    }
}

.gallery-card:hover .group-hover\:opacity-100 > div > div:first-child {
    animation: elegantPulse 2s ease-in-out infinite;
}

/* Text reveal animation */
.gallery-card h3 {
    background: linear-gradient(90deg, #374151, #374151, #3B82F6, #10B981);
    background-size: 400% 400%;
    background-clip: text;
    -webkit-background-clip: text;
    transition: all 0.7s ease;
}

.gallery-card:hover h3 {
    animation: gradientShift 2s ease infinite;
}

/* Premium glow effect */
.gallery-card:hover {
    box-shadow:
        0 25px 50px -12px rgba(59, 130, 246, 0.25),
        0 0 60px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Particle animation */
@keyframes particleFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) rotate(360deg);
        opacity: 0;
    }
}

.gallery-card:hover .animate-pulse {
    animation: particleFloat 3s ease-in-out infinite;
}

/* Smooth image transition */
.gallery-card img {
    filter: brightness(1) contrast(1) saturate(1);
    transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-card:hover img {
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* Line-clamp utility for description */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive optimizations */
@media (max-width: 640px) {
    .gallery-card {
        margin-bottom: 2rem;
    }

    .gallery-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .gallery-card {
        background: rgba(31, 41, 55, 0.9);
        border: 1px solid rgba(75, 85, 99, 0.3);
    }
}

/* Additional gallery card styles */
.gallery-card {
    cursor: pointer !important;
    user-select: none;
}

.gallery-card:hover {
    cursor: pointer !important;
}

.gallery-card * {
    pointer-events: none;
}

.gallery-card {
    pointer-events: all !important;
}

/* Modal Styles */
#image-modal {
    z-index: 99999 !important;
}

.modal-open {
    display: block !important; 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100vw !important; 
    height: 100vh !important; 
    z-index: 99999 !important;
}

.modal-closed {
    display: none !important;
}
