/* Alpine.js cloak */
[x-cloak] { display: none !important; }

/* Horizontal nav scroll (mobile + desktop overflow) */
.mobile-nav-scroll,
.desktop-nav-scroll {
    overflow-x: auto;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

.mobile-nav-scroll > *,
.desktop-nav-scroll > * {
    flex: 0 0 auto;
}

.mobile-nav-scroll::-webkit-scrollbar,
.desktop-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in-delay-1 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.animate-fade-in-delay-3 {
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.6s forwards;
}

/* Parallax effects */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    right: 0;
    bottom: -20%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    transition: transform 0.1s linear;
}

/* Placeholder background gradients for when images are missing */
.parallax-bg {
    background-color: rgb(var(--wedding-300));
    background-image: linear-gradient(135deg, rgb(var(--wedding-200)) 0%, rgb(var(--wedding-300)) 50%, rgb(var(--wedding-500)) 100%);
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* FAQ accordion */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-content.open {
    max-height: 500px;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid rgb(var(--wedding-500));
    outline-offset: 2px;
}

/* Form styling */
input[type="email"],
input[type="password"],
input[type="text"] {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: rgb(var(--wedding-500));
    box-shadow: 0 0 0 3px rgb(var(--wedding-500) / 0.1);
}

/* Button hover effects */
.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(var(--wedding-500) / 0.3);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Timeline styling */
.timeline-line {
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgb(var(--wedding-200)), rgb(var(--wedding-300)));
}

@media (min-width: 768px) {
    .timeline-line {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Timeline dots */
.timeline-dot {
    position: absolute;
    left: 1rem;
    width: 12px;
    height: 12px;
    background: rgb(var(--wedding-500));
    border-radius: 50%;
    transform: translateX(-50%);
    border: 3px solid rgb(var(--wedding-50));
    box-shadow: 0 0 0 2px rgb(var(--wedding-300));
}

@media (min-width: 768px) {
    .timeline-dot {
        left: 50%;
    }
}

/* Photo gallery grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to {
        left: 100%;
    }
}

/* Auth modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 28rem;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.open .modal-content {
    transform: translateY(0);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 200;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    min-width: 12rem;
    background: white;
    border: 1px solid rgb(var(--wedding-200));
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0;
    z-index: 60;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: rgb(var(--wedding-700));
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.user-dropdown-item:hover {
    background-color: rgb(var(--wedding-50));
    color: rgb(var(--wedding-900));
}

.user-dropdown-item.danger {
    color: #dc2626;
}

.user-dropdown-item.danger:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}

.user-dropdown-chevron {
    transition: transform 0.2s ease;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .parallax-section {
        page-break-inside: avoid;
    }

    .parallax-bg {
        position: static;
        background: none;
    }
}

/* ── UI Element Colour Overrides ─────────────────────────────────────────────
   These rules use CSS custom properties served by /dynamic/colors.css and
   configured in the admin Colours page. Specificity is raised above Tailwind's
   single-class rules (.bg-white = 0,1,0,0) so these win without !important,
   except for inputs where !important ensures the override is always applied.
   ────────────────────────────────────────────────────────────────────────── */

/* Navigation bar & title bar */
nav.bg-white,
nav .bg-white {
    background-color: rgb(var(--ui-nav-bg, 255 255 255));
}

/* Card & box surfaces inside page content */
main .bg-white.rounded-lg,
main .bg-white.rounded-xl,
main .bg-white.rounded-md,
div.bg-white.rounded-lg,
div.bg-white.rounded-xl {
    background-color: rgb(var(--ui-card-bg, 255 255 255));
}

/* Modal & toast surfaces */
.modal-content {
    background-color: rgb(var(--ui-card-bg, 255 255 255));
}

/* Footer */
footer.bg-white {
    background-color: rgb(var(--ui-footer-bg, 255 255 255));
}

/* Button & CTA text — targets elements that carry both a background and text-white */
.bg-wedding-600.text-white,
.bg-wedding-700.text-white,
button.bg-wedding-600,
a.bg-wedding-600 {
    color: rgb(var(--ui-button-text, 255 255 255));
}

/* Form inputs & textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
textarea,
select {
    background-color: rgb(var(--ui-input-bg, 255 255 255)) !important;
}

/* Body text inside cards & component boxes */
main .bg-white.rounded-lg .text-wedding-700,
main .bg-white.rounded-xl .text-wedding-700,
main .bg-white.rounded-md .text-wedding-700 {
    color: rgb(var(--ui-component-text, 16 86 102));
}
