/* Premium Preloader - Minimalist Tea Ceremony Theme */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fdfcfa 0%, rgba(200, 164, 126, 0.05) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    transform: scale(0.9);
    animation: preloaderScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes preloaderScale {
    to {
        transform: scale(1);
    }
}

/* Premium SVG Logo Animation */
.tea-logo-animation {
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 30px rgba(45, 90, 61, 0.1));
}

.tea-logo-animation svg {
    width: 100px;
    height: 100px;
}

.tea-leaf-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    stroke: url(#teaGradient);
    stroke-width: 2.5;
    animation: drawPath 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.2s;
    filter: drop-shadow(0 2px 4px rgba(45, 90, 61, 0.2));
}

.tea-circle {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    stroke: var(--accent-gold);
    stroke-width: 1.5;
    animation: drawCircle 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.5s;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
        opacity: 0.4;
    }
}

.loading-text {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.8s;
    letter-spacing: 5px;
    font-weight: 400;
    position: relative;
}

.loading-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100px;
    height: 2px;
    background: var(--accent-gold);
    animation: expandLine 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 1.2s;
}

@keyframes expandLine {
    to {
        transform: translateX(-50%) scaleX(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Hero Background Layers */
.hero-enhanced {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-layers {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Multi-layered gradient background for depth */
.hero-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top right, rgba(200, 164, 126, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at bottom left, rgba(45, 90, 61, 0.04) 0%, transparent 40%),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Premium mist effect with parallax */
.hero-mist {
    position: absolute;
    width: 120%;
    height: 120%;
    left: -10%;
    top: -10%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.4) 0%, transparent 35%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(200, 164, 126, 0.05) 0%, transparent 50%);
    opacity: 0.5;
    animation: mistFloat 30s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

@keyframes mistFloat {
    0%, 100% { 
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg); 
    }
    33% { 
        transform: translate3d(-5%, -3%, 0) scale(1.02) rotate(1deg); 
    }
    66% { 
        transform: translate3d(3%, -2%, 0) scale(1.01) rotate(-1deg); 
    }
}

/* Floating tea elements with 3D effect */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    perspective: 1000px;
}

.floating-leaf {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0;
    animation: leafAppear 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.floating-leaf::before {
    content: '🍃';
    font-size: 24px;
    display: block;
    filter: drop-shadow(0 5px 10px rgba(45, 90, 61, 0.1));
    animation: floatAndRotate 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.floating-leaf:nth-child(1) { 
    top: 15%; 
    left: 85%; 
    animation-delay: 0.5s;
}

.floating-leaf:nth-child(1)::before { 
    animation-delay: 0s;
    animation-duration: 22s;
}

.floating-leaf:nth-child(2) { 
    top: 60%; 
    left: 10%; 
    animation-delay: 1s;
}

.floating-leaf:nth-child(2)::before { 
    animation-delay: 7s;
    animation-duration: 25s;
}

.floating-leaf:nth-child(3) { 
    top: 40%; 
    left: 90%; 
    animation-delay: 1.5s;
}

.floating-leaf:nth-child(3)::before { 
    animation-delay: 14s;
    animation-duration: 28s;
}

@keyframes leafAppear {
    to {
        opacity: 0.15;
    }
}

@keyframes floatAndRotate {
    0%, 100% { 
        transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); 
    }
    25% { 
        transform: translate3d(-30px, -20px, 50px) rotateX(180deg) rotateY(90deg) rotateZ(45deg); 
    }
    50% { 
        transform: translate3d(20px, -35px, -30px) rotateX(360deg) rotateY(180deg) rotateZ(90deg); 
    }
    75% { 
        transform: translate3d(-40px, -15px, 20px) rotateX(180deg) rotateY(270deg) rotateZ(180deg); 
    }
}

/* Premium content reveal animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered reveals for grid items */
.tea-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: cardReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tea-card:nth-child(1) { animation-delay: 0.1s; }
.tea-card:nth-child(2) { animation-delay: 0.2s; }
.tea-card:nth-child(3) { animation-delay: 0.3s; }
.tea-card:nth-child(4) { animation-delay: 0.4s; }
.tea-card:nth-child(5) { animation-delay: 0.5s; }
.tea-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hero content entrance animation */
.hero-content {
    animation: heroContentReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes heroContentReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium page transitions */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-gold));
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-overlay.active {
    transform: translateY(0);
}

/* Smooth parallax scrolling effect */
.parallax-element {
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium hover effects */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-effect {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        animation: none !important;
        transition: none !important;
    }
    
    .hero-mist,
    .floating-elements {
        display: none;
    }
}

/* Mobile optimizations - disable complex animations */
@media (max-width: 768px) {
    .floating-elements {
        display: none;
    }
    
    .hero-mist {
        animation: none;
        opacity: 0.3;
    }
    
    .loading-text { 
        font-size: 1.4rem; 
        letter-spacing: 3px; 
    }
    
    .tea-logo-animation svg {
        width: 80px;
        height: 80px;
    }
}

/* High performance mode for low-end devices */
@media (max-width: 480px) {
    .hero-mist,
    .floating-elements,
    .hero-gradient {
        display: none;
    }
    
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .tea-card {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Custom scrollbar animation */
::-webkit-scrollbar-thumb {
    transition: background 0.3s ease;
}

/* Loading skeleton for lazy content */
.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.skeleton-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    animation: skeleton-wave 1.5s infinite;
}

@keyframes skeleton-wave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}