/* Custom Styles for Caren's Coffee & Donut Shop */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: #40e0d0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #36b5a5;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #40e0d0;
    transition: width 0.3s ease;
}

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

/* Mobile Menu */
.mobile-link {
    position: relative;
}

/* Menu Toggle Animation */
.menu-line {
    transition: all 0.3s ease;
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

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

/* Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.fade-up {
    opacity: 1;
    transform: translateY(0);
}

.reveal.fade-up {
    opacity: 0;
    transform: translateY(30px);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal.fade-up {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal.visible.fade-up {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back to Top */
.back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:not(.visible) {
    transform: translateY(10px);
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

/* Input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

/* Selection color */
::selection {
    background: #40e0d0;
    color: #0a1628;
}

/* Focus visible styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #40e0d0;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav, .back-to-top, #back-to-top {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
