/**
 * Enhanced Custom Styles for Salon Booking System
 * Optimized for Performance, SEO, and Modern UX
 */

/* Performance: Reduce repaints */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth Animations with GPU acceleration */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateZ(0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateZ(0);
    }
    50% {
        transform: translateY(-20px) translateZ(0);
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(17, 24, 39, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(17, 24, 39, 0.6);
    }
}

@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(50px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.4s ease-out;
    will-change: opacity, transform;
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out;
    will-change: opacity;
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out;
    will-change: opacity, transform;
}

.animate-slide-in-right {
    animation: slide-in-right 0.5s ease-out;
    will-change: opacity, transform;
}

.animate-scale-in {
    animation: scale-in 0.4s ease-out;
    will-change: opacity, transform;
}

.animate-on-load {
    opacity: 0;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Enhanced Page Backgrounds with subtle patterns */
.page-bg-home {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 50%, #f3f4f6 100%);
    background-attachment: fixed;
    position: relative;
}

.page-bg-home::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.page-bg-booking {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    background-attachment: fixed;
}

.page-bg-about {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    background-attachment: fixed;
}

/* Navigation Active State */
.nav-link.active,
.nav-mobile-link.active {
    background-color: #111827;
    color: white;
}

.nav-link.active:hover,
.nav-mobile-link.active:hover {
    background-color: #1f2937;
}

/* Enhanced Form Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(17, 24, 39, 0.1);
    outline: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: #9ca3af;
}

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 2.75rem;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-with-icon:focus-within .input-icon {
    color: #111827;
}

/* Enhanced Button Styles - Corporate Level */
button:not(:disabled),
.btn-primary,
.btn-secondary {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.025em;
}

button:not(:disabled)::before,
.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

button:not(:disabled):hover::before,
.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

button:not(:disabled):hover,
.btn-primary:hover {
    transform: translateY(-3px) translateZ(0) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

button:not(:disabled):active,
.btn-primary:active {
    transform: translateY(-1px) translateZ(0) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary button gradient */
.btn-primary {
    background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-position: 100% 0;
    animation: gradient-shift 3s ease infinite;
}

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

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Toast Notifications */
.toast-container {
    z-index: 9999;
    pointer-events: auto;
}

.toast-container button {
    pointer-events: auto;
    cursor: pointer;
}

/* Loading Screen */
#loading-screen {
    backdrop-filter: blur(4px);
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form Validation States */
input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Optimized Smooth Transitions */
* {
    transition-property: color, background-color, border-color, transform, opacity, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable transitions for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

/* Card Enhancements - Corporate Level */
.card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-8px) translateZ(0) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Premium Card with Gradient Border */
.card-premium {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    padding: 2px;
    background-clip: padding-box;
}

.card-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.1), rgba(17, 24, 39, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1;
}

/* Image Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Loading States */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #111827;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Enhanced Alert/Toast Styles */
.alert {
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slide-in-right 0.4s ease-out;
}

/* Progress Bar Animation */
.progress-bar {
    transition: width 0.3s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    #booking-section,
    #loading-screen,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    * {
        box-shadow: none !important;
    }
}

/* Performance: Contain layout */
.container,
.card,
button {
    contain: layout style paint;
}

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

/* Premium hover effects */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Text gradient animations */
@keyframes text-shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.text-shimmer {
    background: linear-gradient(90deg, #111827 0%, #4b5563 50%, #111827 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-shimmer 3s linear infinite;
}

/* Section spacing */
section {
    scroll-margin-top: 80px;
}

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

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #111827 0%, #4b5563 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1f2937 0%, #6b7280 100%);
}

/* Accessibility: Focus visible enhancement */
*:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can be extended for dark mode */
}

