/* ==========================================================================
   VILAYATI - Design Tokens & Custom CSS Rules (Extends Tailwind CSS)
   ========================================================================== */

:root {
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
}

/* ==========================================================================
   Tailwind Specific Overrides & Custom Helpers
   ========================================================================== */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Link Underline Effect */
.nav-underline-hover {
    position: relative;
}
.nav-underline-hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: #003527; /* Tailwind primary */
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-underline-hover:hover::after {
    width: 100%;
}

/* Scroll Reveal Elements */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }
.reveal-delay-4 { transition-delay: 0.6s; }

/* Image Hover Zoom */
.product-image-zoom {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover .product-image-zoom,
.reveal:hover .product-image-zoom {
    transform: scale(1.04);
}

/* ==========================================================================
   Luxury Preloader Screen
   ========================================================================== */

#preloader {
    background: #f8f9fa;
    background-image: radial-gradient(circle at center, #ffffff 0%, #f8f9fa 100%);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.thread-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawThread 2s infinite linear;
}

.needle-path {
    animation: stitchNeedle 2s infinite ease-in-out;
    transform-origin: center;
}

@keyframes drawThread {
    to {
        stroke-dashoffset: 0;
    }
}

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

/* ==========================================================================
   Hero Pin Section (Sticky Viewport & Canvas)
   ========================================================================== */

/* Canvas full-screen fitting helper */
#hero-animation-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000000;
}

/* Story Cards Transitions inside the Hero Section */
.hero-story-card {
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Header Scroll Transitions (Theme Switching)
   ========================================================================== */

/* Navbar Transparent Dark Theme (Overlay on dark hero canvas) */
.nav-transparent-dark {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-transparent-dark .brand-logo img {
    filter: brightness(0) invert(1);
}
.nav-transparent-dark .nav-underline-hover {
    color: rgba(255, 255, 255, 0.75) !important;
}
.nav-transparent-dark .nav-underline-hover:hover {
    color: #ffe088 !important; /* secondary fixed */
}
.nav-transparent-dark .nav-underline-hover::after {
    background-color: #ffe088 !important;
}
.nav-transparent-dark .btn-nav-action {
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}
.nav-transparent-dark .btn-nav-action:hover {
    background-color: #ffffff !important;
    color: #003527 !important;
    border-color: transparent !important;
}
.nav-transparent-dark .mobile-nav-toggle span {
    background-color: #ffffff !important;
}

/* Navbar Solid Light Theme (Overlay on content) */
.nav-solid-light {
    background-color: rgba(248, 249, 250, 0.96) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(191, 201, 195, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}
.nav-solid-light .brand-logo {
    color: #003527 !important; /* primary deep emerald */
}
.nav-solid-light .nav-underline-hover {
    color: #404944 !important; /* on-surface-variant */
}
.nav-solid-light .nav-underline-hover:hover {
    color: #003527 !important;
}
.nav-solid-light .nav-underline-hover::after {
    background-color: #003527 !important;
}
.nav-solid-light .btn-nav-action {
    border-color: #003527 !important;
    color: #003527 !important;
}
.nav-solid-light .btn-nav-action:hover {
    background-color: #003527 !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
.nav-solid-light .mobile-nav-toggle span {
    background-color: #003527 !important;
}

/* Custom Scroll Bar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f8f9fa;
}
::-webkit-scrollbar-thumb {
    background: #bfc9c3; /* outline-variant */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #735c00; /* secondary */
}

/* Mobile Drawer Overlay styles */
.mobile-menu-drawer {
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-menu-drawer.active {
    transform: translateY(0);
}

/* Custom Forms */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23404944'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em;
}

/* Active navigation subpage underline indicator */
.active-nav-link {
    color: #003527 !important;
}
.active-nav-link::after {
    width: 100% !important;
    background-color: #003527 !important;
}

/* Product Catalog Category Tabs */
.category-tab {
    border: 1px solid rgba(0, 53, 39, 0.15);
    color: #003527;
    background: transparent;
}
.category-tab.active {
    background-color: #003527 !important;
    color: #ffffff !important;
    border-color: #003527 !important;
}

/* Modal animation support */
#product-detail-modal {
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#product-detail-modal .bg-surface {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
