/* Gallery Specific Styles for White Background Theme */

/* Base animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) skewX(-12deg);
    }

    100% {
        transform: translateX(200%) skewX(-12deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-soft {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    }

    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.25);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.3),
            0 0 10px rgba(59, 130, 246, 0.2),
            0 0 15px rgba(59, 130, 246, 0.1);
    }

    50% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.4),
            0 0 20px rgba(59, 130, 246, 0.3),
            0 0 30px rgba(59, 130, 246, 0.2);
    }
}

/* Body and general styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: #ffffff;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body.loaded {
    transition: all 0.3s ease;
}

/* Hero Section Enhancements */
.hero-section {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    background: linear-gradient(135deg, #1f2937 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero-section p {
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Gallery Card Enhancements */
.gallery-card {
    position: relative;
    background: #fff;
    /* Ensure white background */
    border-radius: 1rem;
    /* Rounded corners */
    border: 2px solid #fff;
    /* White border for clear corners */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideInFromBottom 0.6s ease-out both;
    cursor: pointer;
    overflow: hidden;
    /* Ensures children respect border-radius */
}

.gallery-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
        0 15px 35px rgba(59, 130, 246, 0.1);
}

.gallery-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3),
        0 25px 50px rgba(0, 0, 0, 0.15);
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-card:hover::before {
    opacity: 1;
}

/* Image container enhancements */
.gallery-card .image-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
}

.gallery-card img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1) contrast(1.05) saturate(1.1);
}

.gallery-card:hover img {
    transform: scale(1.15) rotate(1deg);
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* Category badge */
.gallery-card .category-badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-card:hover .category-badge {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    transform: scale(1.05);
}

/* Content area */
.gallery-card .content-area {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gallery-card h3 {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1f2937 0%, #3b82f6 0%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
}

.gallery-card:hover h3 {
    background-position: 100% 0;
    transform: translateX(2px);
}

/* View detail button */
.gallery-card .view-detail {
    position: relative;
    overflow: hidden;
}

.gallery-card .view-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.gallery-card:hover .view-detail::before {
    left: 100%;
}

.gallery-card .view-detail svg {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gallery-card:hover .view-detail svg {
    transform: translateX(4px) scale(1.1);
}

/* Modal Enhancements */
#modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#modal-content {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
    overflow: hidden;
    background: transparent;
}

#modal.opacity-100 #modal-content {
    animation: bounceIn 0.5s ease-out;
}

/* Modal image container - Dark top section */
#modal-image-container {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    position: relative;
    border-radius: 1rem 1rem 0 0;
}

#modal-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

/* Modal content section - White bottom section */
.modal-content-section {
    background: #ffffff;
    border-radius: 0 0 1rem 1rem;
    position: relative;
    z-index: 2;
}

/* Close button */
#close-modal {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

#close-modal:hover {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    transform: scale(1.1) rotate(90deg);
    border-color: rgba(239, 68, 68, 0.9);
}

/* Modal image */
#modal-image {
    transition: all 0.5s ease;
    filter: brightness(1) contrast(1.05);
    position: relative;
    z-index: 2;
    border-radius: 0.5rem;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

#modal-image:hover {
    filter: brightness(1.05) contrast(1.1);
    transform: scale(1.02);
}

/* Modal image placeholder */
#modal-image-container .image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    z-index: 3;
}

#modal-image-container .image-placeholder svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
}

/* Modal loading state */
#modal-image-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
    z-index: 4;
}

/* Action buttons in modal */
.modal-action-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modal-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modal-action-btn:hover::before {
    left: 100%;
}

.modal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Empty state enhancements */
.empty-state {
    animation: fadeInUp 0.8s ease-out;
}

.empty-state .icon-container {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    transition: all 0.3s ease;
}

.empty-state:hover .icon-container {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: scale(1.05);
}

.empty-state svg {
    transition: all 0.3s ease;
}

.empty-state:hover svg {
    color: #3b82f6;
    transform: scale(1.1);
}

/* Load more button */
.load-more-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.load-more-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Particles container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(0.5px);
}

/* Floating animation for particles */
@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(var(--random-x, 0)) rotate(360deg);
        opacity: 0;
    }
}

/* Ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Scroll indicators */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 1000;
}

/* Responsive animations */
@media (max-width: 768px) {
    .gallery-card {
        animation-duration: 0.4s;
    }

    .gallery-card:hover {
        transform: translateY(-6px) scale(1.02);
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    #modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .particles {
        display: none;
        /* Disable particles on mobile for performance */
    }
}

@media (max-width: 480px) {
    .gallery-card {
        margin-bottom: 1rem;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-section p {
        font-size: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gallery-card {
        border: 2px solid #000;
    }

    .gallery-card:hover {
        border-color: #3b82f6;
    }

    .gallery-card h3 {
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particles {
        display: none;
    }

    .shimmer {
        animation: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e2e8f0;
    }

    .gallery-card {
        background: #1e293b;
        border-color: #334155;
    }

    .gallery-card:hover {
        background: #334155;
    }

    .hero-section {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }

    #modal-content {
        background: #1e293b;
        border-color: #334155;
    }
}

/* Print styles */
@media print {

    .particles,
    #modal,
    .load-more-btn {
        display: none !important;
    }

    .gallery-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .gallery-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

/* Selection styles */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* Focus styles for accessibility */
.gallery-card:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}