/* Animation Styles - Shared across all pages */

/* Base Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    animation: fadeInRight 0.8s ease-out forwards;
}

.fade-in-scale {
    opacity: 0;
    transform: scale(0.8);
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Keyframe Animations */
@keyframes fadeInUp {
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    to { 
        opacity: 1; 
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    to { 
        opacity: 1; 
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Hero Animations */
.hero-title {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: heroTitleIn 0.8s ease-out 0.3s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out 0.6s forwards;
}

.hero-button {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    animation: buttonIn 0.5s ease-out 0.9s forwards;
}

@keyframes heroTitleIn {
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

@keyframes buttonIn {
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* Gallery Title Animation */
.gallery-title {
    opacity: 0;
    transform: translateY(50px) scale(0.8);
    animation: titleReveal 1s ease-out 0.2s forwards;
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    70% {
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* Scroll-triggered Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

.text-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.text-reveal.animate {
    opacity: 1;
    transform: translateY(0);
}

.grid-animate {
    opacity: 0;
    transform: translateY(40px) rotateX(20deg);
    transition: all 0.6s ease;
}

.grid-animate.animate {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.section-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.section-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Elegant Navigation Cards */
.elegant-card {
    position: relative;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.elegant-card:hover {
    transform: translateY(-8px);
    border-color: #CD5C5C;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(205, 92, 92, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.elegant-card-number {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #666;
    transition: color 0.3s ease;
}

.elegant-card:hover .elegant-card-number {
    color: #CD5C5C;
}

.elegant-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.elegant-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.elegant-card:hover .elegant-card-title {
    color: #CD5C5C;
}

.elegant-card-cta {
    display: flex;
    align-items: center;
    color: #888;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.elegant-card:hover .elegant-card-cta {
    color: #CD5C5C;
}

.elegant-arrow {
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.elegant-card:hover .elegant-arrow {
    transform: translateX(4px);
}

.elegant-card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #CD5C5C, #FF6B6B);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.elegant-card:hover .elegant-card-accent {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .elegant-card {
        padding: 1.75rem;
        min-height: 200px;
    }
    
    .elegant-card-title {
        font-size: 1.625rem;
        margin-bottom: 1.25rem;
    }
    
    .elegant-card-number {
        top: 1.25rem;
        right: 1.25rem;
        font-size: 1rem;
    }
}

/* Legacy Split Card Animations */
.split-card {
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #2a2a2a;
    height: 400px;
}

.split-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(205, 92, 92, 0.1), 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #CD5C5C;
}

.split-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.split-card-content {
    height: 200px;
    background: linear-gradient(135deg, #1a1a1a 0%, #262626 100%);
    position: relative;
}

.split-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #CD5C5C, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.split-card:hover .split-card-content::before {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .split-card {
        height: 350px;
    }
    
    .split-card-image {
        height: 180px;
    }
    
    .split-card-content {
        height: 170px;
    }
}

/* Legacy Card Hover Animations */
.card-hover {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.card-hover img {
    transition: transform 0.4s ease;
}

.card-hover:hover img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(205,92,92,0.1), rgba(0,0,0,0.9));
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.card-hover:hover .card-overlay {
    opacity: 1;
}

.card-overlay h3 {
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.card-overlay p {
    transform: translateY(20px);
    transition: transform 0.3s ease 0.2s;
}

.card-hover:hover .card-overlay h3,
.card-hover:hover .card-overlay p {
    transform: translateY(0);
}

/* Specific Card Types */
.artwork-card {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #1a1a1a;
    transform-style: preserve-3d;
}

.artwork-card:hover {
    transform: translateY(-12px) rotateY(5deg) rotateX(5deg);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(205,92,92,0.2);
}

.artwork-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.artwork-card:hover img {
    transform: scale(1.1) rotate(2deg);
}

.artwork-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    pointer-events: none;
}

.artwork-card:hover .artwork-overlay {
    opacity: 1;
}

.artwork-overlay h3 {
    color: var(--fg-primary);
    transform: translateY(20px);
    transition: all 0.3s ease 0.1s;
}

.artwork-overlay p {
    color: var(--fg-secondary);
    transform: translateY(20px);
    transition: all 0.3s ease 0.2s;
}

.artwork-card:hover .artwork-overlay h3,
.artwork-card:hover .artwork-overlay p {
    transform: translateY(0);
}

.review-card,
.media-card,
.exhibition-card {
    transition: all var(--transition-medium);
}

.review-card:hover,
.media-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.exhibition-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.exhibition-card img {
    transition: transform 0.4s ease;
}

.exhibition-card:hover img {
    transform: scale(1.05);
}

/* Image Container Effects */
.image-container {
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius);
    transition: all 0.4s ease;
}

.image-container:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.image-container img {
    transition: transform 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.1);
}

/* Bounce Animation */
.bounce {
    animation: simpleBounce 2s infinite;
}

@keyframes simpleBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Loading Animations */
.loading-fade {
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.loading-fade.loaded {
    opacity: 1;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-transform-opacity {
    will-change: transform, opacity;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .fade-in-scale,
    .hero-title,
    .hero-subtitle,
    .hero-button,
    .gallery-title {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .scroll-animate,
    .text-reveal,
    .grid-animate,
    .section-animate {
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    .bounce {
        animation: none;
    }
    
    .card-hover:hover,
    .artwork-card:hover,
    .review-card:hover,
    .media-card:hover,
    .exhibition-card:hover,
    .image-container:hover {
        transform: none;
    }
    
    /* CRITICAL FIX for mobile gallery - only on mobile */
    @media (max-width: 768px) {
        .artwork-card {
            aspect-ratio: unset !important;
            transform-style: flat !important;
            position: relative !important;
            display: block !important;
            height: 280px !important;
            transform: none !important;
        }
        
        .artwork-card img {
            position: relative !important;
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            object-fit: cover !important;
            transform: none !important;
        }
        
        .grid-animate {
            animation: none !important;
        }
    }
}