/* Custom CSS for Sahana - NailArt Website */

/* Font Classes */
.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-poppins {
    font-family: 'Poppins', sans-serif;
}

/* Custom Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(-8deg);
    }
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up-delayed {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up-more-delayed {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes brush-stroke-1 {
    0% {
        opacity: 0;
        transform: translateX(-50px) rotate(-5deg) scale(0.8);
    }
    50% {
        opacity: 0.15;
        transform: translateX(0px) rotate(2deg) scale(1);
    }
    100% {
        opacity: 0.15;
        transform: translateX(50px) rotate(-2deg) scale(1.1);
    }
}

@keyframes brush-stroke-2 {
    0% {
        opacity: 0;
        transform: translateX(50px) rotate(5deg) scale(0.9);
    }
    50% {
        opacity: 0.12;
        transform: translateX(0px) rotate(-3deg) scale(1);
    }
    100% {
        opacity: 0.12;
        transform: translateX(-50px) rotate(3deg) scale(1.05);
    }
}

@keyframes brush-stroke-3 {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotate(-8deg) scale(0.7);
    }
    50% {
        opacity: 0.1;
        transform: translateY(0px) rotate(4deg) scale(1);
    }
    100% {
        opacity: 0.1;
        transform: translateY(30px) rotate(-4deg) scale(1.2);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes text-shimmer {
    0% {
        background-position: -100% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.8);
    }
}

/* Animation Classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 8s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fade-in-up 1s ease-out forwards;
}

.animate-fade-in-up-delayed {
    animation: fade-in-up-delayed 1s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-in-up-more-delayed {
    animation: fade-in-up-more-delayed 1s ease-out 0.4s forwards;
    opacity: 0;
}

.animate-brush-stroke-1 {
    animation: brush-stroke-1 8s ease-in-out infinite;
}

.animate-brush-stroke-2 {
    animation: brush-stroke-2 10s ease-in-out infinite;
}

.animate-brush-stroke-3 {
    animation: brush-stroke-3 12s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Shimmer Text Effect */
.shimmer-text {
    position: relative;
    background: linear-gradient(
        135deg,
        #ec4899 0%,
        #f472b6 25%,
        #c084fc 50%,
        #f472b6 75%,
        #ec4899 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s ease-in-out infinite;
}

.shimmer-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.5s ease-in-out infinite;
    z-index: 1;
}

/* Gallery Zoom Styles */
.gallery-image {
    transform-origin: center;
    transition: transform 0.3s ease-out;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gallery-image.cursor-zoom-in {
    cursor: zoom-in;
}

.gallery-image.cursor-zoom-out {
    cursor: zoom-out;
}

.gallery-image.cursor-grabbing {
    cursor: grabbing !important;
}

/* Prevent text selection during zoom */
.gallery-item.zoomed {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Zoom hint for desktop */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item:not(.zoomed)::after {
    content: '🔍';
    font-size: 14px;
}

.gallery-item.zoomed::after {
    content: '❌';
    font-size: 14px;
}

/* Mobile zoom indicators */
@media (max-width: 768px) {
    .gallery-item::after {
        opacity: 0.7;
    }
    
    .gallery-item:hover::after {
        opacity: 0.7;
    }
}

/* Improved drag experience */
.gallery-item.zoomed .gallery-image {
    cursor: grab;
}

.gallery-item.zoomed .gallery-image:active {
    cursor: grabbing;
}

/* Remove focus outline from header brand link */
nav a[href="#home"].text-2xl {
    outline: none;
    border: none;
    box-shadow: none;
}

nav a[href="#home"].text-2xl:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

nav a[href="#home"].text-2xl:active {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Mobile Gallery Optimizations */
@media (max-width: 768px) {
    .instagram-gallery {
        padding: 2px;
        margin: 0 auto;
        max-width: 100%;
    }
    
    .instagram-gallery .grid {
        gap: 1px !important;
    }
    
    .gallery-item {
        aspect-ratio: 1;
        width: 100%;
        height: auto;
        min-height: 150px;
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    .gallery-item .fullscreen-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        top: 8px !important;
        right: 8px !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(4px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        transform: scale(1);
        transition: all 0.2s ease;
    }
    
    .gallery-item .fullscreen-btn:hover {
        transform: scale(1.1);
        background: rgba(0, 0, 0, 0.8) !important;
    }
    
    .gallery-item .fullscreen-btn:active {
        transform: scale(0.95);
    }
    
    /* Make fullscreen button always visible on mobile */
    .gallery-item .fullscreen-btn {
        opacity: 0.8 !important;
    }
    
    .gallery-item:hover .fullscreen-btn {
        opacity: 1 !important;
    }
    
    /* Ensure text is visible on mobile */
    .animate-pulse {
        animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    }
}

/* Instagram Gallery Styles */
.instagram-gallery {
    background: white;
    padding: 1px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: #f9f9f9;
}

.gallery-item img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.shimmer-overlay {
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.7) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out;
}

.gallery-item:hover .shimmer-overlay {
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for grid items */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }
.animate-on-scroll:nth-child(7) { transition-delay: 0.7s; }
.animate-on-scroll:nth-child(8) { transition-delay: 0.8s; }

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #ec4899, #f472b6, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
    transform: scale(1.05);
}

/* Custom Button Styles */
.btn-luxe {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-luxe::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-luxe:hover::before {
    left: 100%;
}

.btn-luxe:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

/* Navigation Styles */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Styles */
.mobile-menu-open {
    transform: translateX(0) !important;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-hover .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-hover:hover .card-overlay {
    opacity: 1;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #db2777, #ec4899);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(236, 72, 153, 0.3);
    border-radius: 50%;
    border-top-color: #ec4899;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-up-delayed,
    .animate-fade-in-up-more-delayed {
        animation-duration: 0.8s;
    }
    
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .btn-luxe {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    /* Hide some brush animations on mobile for performance */
    .animate-brush-stroke-2 {
        display: none;
    }
    
    /* Simplify gallery on mobile */
    .instagram-gallery {
        padding: 0;
        border-radius: 8px;
    }
    
    .gallery-item:hover img {
        transform: scale(1.05);
    }
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Apply GPU acceleration to animated elements */
.animate-float,
.animate-float-delayed,
.animate-brush-stroke-1,
.animate-brush-stroke-2,
.animate-brush-stroke-3,
.shimmer-text,
.gallery-item img {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce motion for performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize for low-end devices */
@media (max-width: 768px) and (max-height: 1024px) {
    .animate-brush-stroke-1,
    .animate-brush-stroke-2,
    .animate-brush-stroke-3 {
        animation-duration: 20s;
    }
    
    .shimmer-text {
        animation-duration: 5s;
    }
}

/* Selection Color */
::selection {
    background: #ec4899;
    color: white;
}

::-moz-selection {
    background: #ec4899;
    color: white;
}

/* Focus States */
a:focus,
button:focus {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-luxe {
        border: 2px solid #000;
    }
    
    .gradient-text {
        -webkit-text-fill-color: #000;
        background: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
