/* ===== Custom Styles for DTNutrition419 ===== */

/* Base */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0e0d0b;
}

/* Selection */
::selection {
    background-color: rgba(201, 168, 76, 0.3);
    color: #f4f3f0;
}

/* ===== Scroll Reveal Animations ===== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children */
.reveal-on-scroll.delay-1 { transition-delay: 0.1s; }
.reveal-on-scroll.delay-2 { transition-delay: 0.2s; }
.reveal-on-scroll.delay-3 { transition-delay: 0.3s; }
.reveal-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ===== Hero Reveal ===== */
.hero-reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-reveal:nth-child(1) { animation-delay: 0.1s; }
.hero-reveal:nth-child(2) { animation-delay: 0.25s; }
.hero-reveal:nth-child(3) { animation-delay: 0.4s; }
.hero-reveal:nth-child(4) { animation-delay: 0.55s; }
.hero-reveal:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Scroll Line Animation ===== */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(14, 13, 11, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

/* Nav links */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #C9A84C, #f5cc70);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #C9A84C !important;
}

/* ===== Mobile Menu ===== */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #C9A84C;
    transition: width 0.3s ease;
}

.mobile-nav-link:hover::after {
    width: 80%;
}

/* Hamburger animation */
#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 6rem;
}

/* ===== Product Card Hover ===== */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ===== Input Focus ===== */
input:focus,
textarea:focus {
    background-color: rgba(26, 24, 21, 0.8);
}

/* ===== Button Hover Effects ===== */
button,
a[href] {
    cursor: pointer;
}

/* ===== Image Loading ===== */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ===== Smooth Image Transitions ===== */
img {
    transition: filter 0.5s ease;
}

/* ===== Gold Gradient Text (for potential use) ===== */
.text-gold-gradient {
    background: linear-gradient(135deg, #C9A84C 0%, #f5cc70 50%, #C9A84C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Decorative Divider ===== */
.divider-gold {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.divider-gold::before,
.divider-gold::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.4), transparent);
}

/* ===== Subtle Pattern Overlay ===== */
.pattern-overlay {
    background-image: radial-gradient(rgba(201, 168, 76, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .hero-reveal {
        transform: translateY(20px);
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

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

/* ===== Focus Visible ===== */
:focus-visible {
    outline: 2px solid rgba(201, 168, 76, 0.6);
    outline-offset: 2px;
}

/* ===== Image Aspect Ratios ===== */
.aspect-\[4\/3\] {
    aspect-ratio: 4 / 3;
}

.aspect-\[3\/4\] {
    aspect-ratio: 3 / 4;
}

.aspect-\[3\/2\] {
    aspect-ratio: 3 / 2;
}

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

::-webkit-scrollbar-track {
    background: #0e0d0b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6B0F1A, #3d3830);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #9c1528, #7f786a);
}
