/* =======================================
   GALLERY PAGE ANIMATIONS & IMPROVEMENTS
   Анимации и улучшения галереи
   ======================================= */

/* Modal animations */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    z-index: 9999;
    padding: 20px;
    transition: background 0.4s ease;
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.95);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        background: rgba(0,0,0,0);
    }
    to {
        background: rgba(0,0,0,0.95);
    }
}

.modal-content {
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    opacity: 0;
    animation: modalSlideUp 0.4s ease forwards;
}

@keyframes modalSlideUp {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal.closing .modal-content {
    animation: modalSlideDown 0.3s ease forwards;
}

@keyframes modalSlideDown {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
}

/* Close button animation */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a2332;
}

.modal-close:hover {
    background: #ff6b35;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

/* Gallery card hover effects */
.gallery-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0) 0%, rgba(255, 107, 53, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.gallery-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 50px rgba(255, 107, 53, 0.25);
}

.gallery-card:hover::before {
    opacity: 1;
}

/* Card image zoom effect */
.gallery-card-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.gallery-card-image::after {
    content: '👁';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 48px;
    color: white;
    background: rgba(255, 107, 53, 0.9);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery-card:hover .gallery-card-image::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.gallery-card-image img {
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-card-image img {
    transform: scale(1.1);
}

/* Filter buttons animation */
.filter-btn {
    padding: 12px 30px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    color: #1a2332;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    border-color: #ff6b35;
    color: #ff6b35;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    border-color: #ff6b35;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

/* Category badge animation */
.category-badge {
    background: #ff6b35;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.gallery-card:hover .category-badge {
    background: #ff8c5a;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
}

/* View button animation */
.view-btn {
    color: #ff6b35;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.view-btn i {
    transition: transform 0.3s ease;
}

.gallery-card:hover .view-btn {
    gap: 10px;
    color: #ff8c5a;
}

.gallery-card:hover .view-btn i {
    transform: translateX(5px);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card {
    animation: fadeInUp 0.6s ease both;
}

.gallery-card:nth-child(1) { animation-delay: 0.1s; }
.gallery-card:nth-child(2) { animation-delay: 0.2s; }
.gallery-card:nth-child(3) { animation-delay: 0.3s; }
.gallery-card:nth-child(4) { animation-delay: 0.4s; }
.gallery-card:nth-child(5) { animation-delay: 0.5s; }
.gallery-card:nth-child(6) { animation-delay: 0.6s; }

/* Modal slider improvements */
.modal-slider {
    height: 500px;
    position: relative;
    background: #f8f9fa;
}

.modal-slider .slider-handle {
    cursor: col-resize;
    transition: all 0.3s ease;
}

.modal-slider .slider-handle:hover {
    transform: scale(1.1);
}

.modal-slider .slider-handle::before {
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* Modal info animations */
.modal-info {
    padding: 40px;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.modal-info h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #1a2332;
    font-weight: 700;
}

.modal-info p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

/* Breadcrumbs animation */
.breadcrumbs {
    animation: fadeInUp 0.6s ease 0.3s both;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-close {
        width: 45px;
        height: 45px;
        font-size: 24px;
        top: 15px;
        right: 15px;
    }
    
    .modal-slider {
        height: 300px;
    }
    
    .modal-info {
        padding: 25px;
    }
    
    .modal-info h2 {
        font-size: 24px;
    }
    
    .gallery-card:hover {
        transform: translateY(-8px);
    }
    
    .gallery-card-image::after {
        font-size: 36px;
        width: 60px;
        height: 60px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}