/* Custom CSS for Taply */
/* Additional styles beyond Tailwind can be added here */
:root {
    color-scheme: light;
}

body {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Constrain brand logo images used across headers */
img.h-18 {
    width: 150px;
    height: auto;
}

/* Smooth transitions on interactive elements only */
button,
[role="button"],
a,
input,
select,
textarea {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: #fff;
    border-radius: 0.375rem;
    z-index: 100;
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 150ms ease, opacity 150ms ease;
}

.skip-link:focus-visible {
    top: 0.75rem;
    transform: translateY(0);
    opacity: 1;
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Accessibility: ensure clear focus states */
:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* Reduce motion where requested */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Mobile-friendly tap targets */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
}

/* Enhanced active states for touch feedback */
button:active,
[role="button"]:active,
.touch-target:active,
button.active:active,
[role="button"].active:active,
.touch-target.active:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Generous close hit-areas */
.close-hit-area {
    position: relative;
    min-width: 48px;
    min-height: 48px;
}

.close-hit-area::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

/* Smooth drawer transitions */
#mobileMenuPanel,
#mobileSearchPanel {
    will-change: transform;
}

/* Overlay fade helper */
#mobileOverlay {
    transition: opacity 200ms ease;
}

/* Hero spacing tweaks for small screens */
.hero-section {
    min-height: 560px;
}

/* Mobile scrolling helpers */
@media (max-width: 1024px) {
    body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
    }
}

@media (max-width: 1024px) {
    .hero-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

@media (max-width: 640px) {
    .hero-section {
        min-height: auto;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .hero-section h1 {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .hero-section p {
        font-size: 1rem;
    }
}

/* Small-width grid/table resilience */
@media (max-width: 360px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Horizontal scroll for tables on very small screens */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .table-responsive::-webkit-scrollbar {
        height: 4px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 2px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }

    /* Truncate long text on very small screens */
    .truncate-mobile {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: calc(100vw - 2rem);
    }

    /* Ensure touch targets remain accessible */
    .touch-target {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Enhanced carousel momentum scrolling */
.carousel-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll issues on small screens */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .container,
    .max-w-7xl {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

