/* PriceCheck Ghana - Custom Styles */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Selection */
::selection {
    background: rgba(20, 184, 166, 0.3);
    color: white;
}

/* HTMX Indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: flex;
}

.htmx-request.htmx-indicator {
    display: flex;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gradient Text Support for older browsers */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

/* Product Card Hover Effects */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* Smooth Image Loading */
.product-card img {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card img[src=""] {
    opacity: 0;
}

/* Platform Badge Styles */
.platform-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Search Input Focus Ring */
input:focus {
    outline: none;
}

/* Button Gradient Animation */
.btn-gradient {
    background-size: 200% 100%;
    transition: background-position 0.3s ease;
}

.btn-gradient:hover {
    background-position: 100% 0;
}

/* Loading Skeleton Animation */
.skeleton {
    background: linear-gradient(90deg,
            rgba(30, 41, 59, 0.5) 0%,
            rgba(51, 65, 85, 0.5) 50%,
            rgba(30, 41, 59, 0.5) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Mobile Menu Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 300px;
}

/* Backdrop Blur Fallback */
@supports not (backdrop-filter: blur(16px)) {
    .backdrop-blur-xl {
        background: rgba(15, 23, 42, 0.98);
    }
}

/* Hide default browser styles for number inputs */
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;
}

/* Price highlight effect */
.price-highlight {
    position: relative;
}

.price-highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(16, 185, 129, 0.2), transparent);
    border-radius: 4px;
    z-index: -1;
}

/* Best price pulse */
@keyframes best-price-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.best-price-badge {
    animation: best-price-pulse 2s infinite;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    nav,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Loader Animation */
.loader {
    animation: rotate 1s infinite;
    height: 50px;
    width: 50px;
}

.loader:before,
.loader:after {
    border-radius: 50%;
    content: "";
    display: block;
    height: 20px;
    width: 20px;
}

.loader:before {
    animation: ball1 1s infinite;
    background-color: #fff;
    box-shadow: 30px 0 0 #14b8a6;
    /* primary-500 */
    margin-bottom: 10px;
}

.loader:after {
    animation: ball2 1s infinite;
    background-color: #14b8a6;
    /* primary-500 */
    box-shadow: 30px 0 0 #fff;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg) scale(0.8)
    }

    50% {
        transform: rotate(360deg) scale(1.2)
    }

    100% {
        transform: rotate(720deg) scale(0.8)
    }
}

@keyframes ball1 {
    0% {
        box-shadow: 30px 0 0 #14b8a6;
    }

    50% {
        box-shadow: 0 0 0 #14b8a6;
        margin-bottom: 0;
        transform: translate(15px, 15px);
    }

    100% {
        box-shadow: 30px 0 0 #14b8a6;
        margin-bottom: 10px;
    }
}

@keyframes ball2 {
    0% {
        box-shadow: 30px 0 0 #fff;
    }

    50% {
        box-shadow: 0 0 0 #fff;
        margin-top: -20px;
        transform: translate(15px, 15px);
    }

    100% {
        box-shadow: 30px 0 0 #fff;
        margin-top: 0;
    }
}