/* ===== ANIMATIONS ===== */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.animate-fade-in {
    animation: fade-in 0.8s ease-out both;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out both;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== NAVBAR SCROLLED STATE ===== */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.navbar-scrolled #nav-logo {
    color: #111827 !important;
}

/* ===== SMOOTH TOUCH SCROLLING ===== */
html {
    -webkit-overflow-scrolling: touch;
}

/* ===== FORM INPUT AUTOFILL ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
    -webkit-text-fill-color: white;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== QUANTITY INPUT ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===== LIGHTBOX ===== */
#lightbox.active {
    display: flex !important;
}

#lightbox {
    animation: fade-in 0.2s ease-out;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

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

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 640px) {
    /* Larger touch targets */
    input, textarea, select, button {
        min-height: 48px;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    /* Better spacing on small screens */
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Gallery grid adjustment */
    .gallery-item {
        border-radius: 12px;
    }
}

/* ===== SAFE AREA (NOTCH PHONES) ===== */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    footer {
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }
}

/* ===== SELECTION COLOR ===== */
::selection {
    background: rgba(14, 165, 233, 0.3);
    color: inherit;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
    border-radius: 4px;
}
