@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Gravitas+One&display=swap');

/* Modern Design Overrides */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-color: #6A5ACD;
    --light-bg: #F8F9FF;
    --card-shadow: 0 10px 30px rgba(72, 61, 139, 0.15);
    --hover-shadow: 0 15px 35px rgba(72, 61, 139, 0.25);
    --transition: all 0.3s ease;
}

html, body {
    background: var(--light-bg);
    margin: 0;
    padding: 0;
    user-select: none;
    overflow-x: hidden;
    font-family: "Montserrat", sans-serif;
    height: auto;
    width: 100vw;
    overscroll-behavior: none;
    /* prevents page refreshing on overscroll */
    scroll-behavior: smooth;
}

noscript {
    display: block;
    background-color: #000;
    color: #DC143C;
    font-size: 1.1rem;
    font-style: italic;
    padding: 0.82rem;
    margin: 2rem;
    text-align: center;
}

img:not(.raty-widget *) {
    pointer-events: none;
}

.cookie-verification {
    display: none !important;
}

/* Header Redesign */
header {
    background: var(--primary-gradient);
    padding: 1.5rem 0 0;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 100% 100%;
}

.site-title {
    font-size: 2.8rem !important;
    font-family: "Gravitas One", cursive;
    background: linear-gradient(45deg, #fff, #e6e6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5rem;
    line-height: 3.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Search Bar Redesign */
#search-input {
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.7rem 1.5rem;
    transition: var(--transition);
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-container {
    background: rgba(240, 255, 240, 1);
    margin-top: 1.6rem;
    padding: 0.32rem;
    border-radius: 6px;
}

.search-container a {
    color: #6495ED;
    text-decoration: none;
}

/* Navigation Tabs Redesign */
.nav-tabs {
    border-bottom: none;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    border-radius: 16px 16px 0 0;
    padding: 0.5rem;
    margin: 0 auto;
    max-width: 95%;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.7rem 1rem;
    margin: 0 0.2rem;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--accent-color) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

main {
    margin: 3em 0 7em 0;
}

/* Card Redesign */
.merchant, .product {
    border: 1px rgba(155, 155, 155, 0.2) inset;
    padding: 0.56em;
    border-radius: 16px;
    background: #F0F8FF;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    max-width: clamp(9.50em, 25vw, 18rem);
    box-sizing: border-box;
    transition: all 0.3s ease-in;
}

.merchant:hover, .product:hover {
    box-shadow: 0 10px 30px rgba(72, 61, 139, 0.5);
    transform: scale(1.02, 1.02);
}

@media (max-width: 379px) {
    .merchant, .product {
        max-width: clamp(10rem, 25vw, 21rem);
        /* Fluid resizing */
    }
}

@media (min-width: 380px) {
    .merchant, .product {
        max-width: clamp(11em, 25vw, 24rem);
    }
}

.store-merchant-title, .favorite-merchant-title, .product-title {
    color: #483D8B;
    font-size: 0.7rem;
    font-weight: 700;
}

.img-placeholder {
    max-width: 98%;
    min-height: 10.5em;
    background-color: #e0e0e0;
    border-radius: 5px;
}

.badge-content {
    position: absolute;
    top: 1rem !important;
    left: 1.8rem !important;
    opacity: 0.6;
    z-index: 999;
}

/* Badge styling */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.badge.bg-danger {
    background: var(--secondary-gradient) !important;
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.img-wrapper {
    border-radius: 4px;
    border: 1px padding solid !important;
}

.img-wrapper:hover {
    border: 1px blue solid !important;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.img-placeholder {
    position: relative;
}

.shimmer-placeholder {
    z-index: 1;
}

.merchant-logo, .product-image {
    height: 110px;
    width: 110px;
    position: relative;
    z-index: 2;
}

.merchant:hover .merchant-logo,
.product:hover .product-image {
    transform: scale(1.05);
}

/* Button Redesign */
.btn {
    border-radius: 10px;
    transition: var(--transition);
}

.favorite-btn, .share-btn, .store-link {
    background: var(--light-bg);
    border: 1px solid rgba(72, 61, 139, 0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.favorite-btn:hover, .share-btn:hover, .store-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

/* Tab Content Styling */
.tab-content {
    padding: 2rem 0;
}

.tab-pane h5 {
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.tab-pane h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-gradient);
    border-radius: 3px;
}

/* Stats and Counters */
.stat {
    font-weight: 700;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Accordion Redesign */
.accordion-button {
    border-radius: 12px !important;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background: var(--light-bg);
    color: var(--accent-color);
    box-shadow: 0 2px 10px rgba(72, 61, 139, 0.1);
}

.accordion-body {
    font-size: 0.85rem;
}

/* List group items */
.list-group-item {
    border: none;
    padding: 0.5rem;
    background: transparent;
}

.list-group-item small {
    font-weight: 500;
}

.rating-btn, .revisit-btn {
    font-size: 0.7rem;
}

td strong {
    color: #483D8B;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .site-title {
        font-size: 2rem !important;
        letter-spacing: 0.3rem;
        line-height: 2.5rem;
    }

    .nav-link {
        font-size: 0.8rem !important;
        padding: 0.5rem;
    }
}

/* Anchor Button Redesign */
.anchor-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    position: fixed;
    right: 3%;
    bottom: 7%;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    padding: 2px;
    border: 2px #483D8B solid;
    color: #00BFFF;
    font-size: 2.2rem;
    background: var(--primary-gradient);
    box-shadow: 0 5px 15px rgba(72, 61, 139, 0.3);
    z-index: 9999;
    transition: var(--transition);
}

.anchor-hidden {
    opacity: 0;
    pointer-events: none;
}

.anchor-visible {
    opacity: 1;
    pointer-events: auto;
}

.anchor-container:active {
    background: var(--light-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(72, 61, 139, 0.4);
}

.offcanvas {
    background-color: transparent !important;
    width: 100vw !important;
    height: 100vh !important;
}

#ratingModal {
    background: rgba(240, 255, 240, 1) !important;
}

.rating-widget {
    position: relative !important;
    z-index: 9999 !important;
}

.loading-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-gradient);
    width: 100%;
    height: 100%;
    z-index: 9999;
    transition: all 0.7s ease-out;
}

.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 100% 100%;
}

.splash-logo {
    max-height: 120px;
    border-radius: 6px;
    border: 2px #AFEEEE solid;
}

.loading-status {
    font-size: 1.2rem;
    position: relative;
    margin: auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #AFEEEE;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast {
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Footer styling */
footer {
    background: var(--primary-gradient);
    color: #eee;
    padding: 1.5rem 0;
    margin-top: 3rem;
}