/* Custom animations and styling overriding or extending Tailwind if needed */
@layer utilities {
    .animation-delay-2000 {
        animation-delay: 2s;
    }

    .animation-delay-4000 {
        animation-delay: 4s;
    }

    .animation-delay-300 {
        animation-delay: 300ms;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-wrap: pretty;
}

body.modal-open {
    overflow: hidden;
}

main {
    display: block;
    flex: 1 0 auto;
}

footer {
    margin-top: auto;
}

.brand-logo {
    display: block;
    width: auto;
    height: auto;
}

.brand-logo-nav {
    max-height: 56px;
}

.brand-logo-footer {
    max-height: 52px;
}

.brand-logo-modal {
    max-height: 48px;
}

img {
    display: block;
    max-width: 100%;
}

.responsive-image {
    width: 100%;
    height: auto;
}

.image-fallback {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 55%, #fff7ed 100%);
}

.image-fallback::after {
    content: "Preview unavailable";
    position: absolute;
    inset: auto 1rem 1rem 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.image-fallback.image-error::after {
    opacity: 1;
}

.image-fallback.image-error img {
    visibility: hidden;
}

.preview-card,
.preview-card-shell {
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.22);
}

.preview-label {
    letter-spacing: 0.18em;
}

.preview-badge {
    white-space: nowrap;
}

.contact-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.contact-dialog.is-open {
    opacity: 1;
    visibility: visible;
}

.contact-panel {
    max-height: calc(100vh - 2rem);
    margin: 1rem auto;
    overflow-y: auto;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.28s ease;
}

.contact-dialog.is-open .contact-panel {
    transform: translateY(0) scale(1);
}

.contact-mode-btn {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-mode-btn:hover {
    transform: translateY(-1px);
}

.faq-trigger[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-icon {
    transition: transform 0.2s ease;
}

#contact-notes {
    resize: vertical;
    min-height: 120px;
}

@media (max-width: 1024px) {
    .preview-badge {
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .brand-logo-nav {
        max-height: 42px;
    }

    .contact-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .contact-panel {
        max-height: calc(100vh - 40px);
        width: 100%;
        margin: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(40px);
    }

    .preview-card,
    .preview-card-shell {
        border-radius: 1.5rem;
    }

    .image-fallback::after {
        inset: auto 0.75rem 0.75rem 0.75rem;
    }
}

@media (max-width: 480px) {
    html,
    body {
        overflow-x: clip;
    }

    .contact-panel {
        max-height: calc(100vh - 16px);
    }

    .preview-label {
        letter-spacing: 0.14em;
    }
}

/* Custom scrollbar for a polished feel */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
