/* ---
   Step 5: Custom "AI/SaaS" Styling
   --- */

/* 1. Root Variables & Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

:root {
    --bs-primary-rgb: 13, 110, 253; /* Bootstrap's Default Blue */
    --bs-dark-rgb: 21, 24, 38;      /* A deep, modern navy blue */
    /* Using Bootstrap's theme colors for consistency */
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-light-grey: #dee2e6;
    --bs-dark: #212529;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa; /* Light grey background for contrast */
}

/* 2. Navbar & Footer */

.navbar.sticky-top {
    background-color: rgb(var(--bs-dark-rgb));
    transition: background-color 0.3s ease-in-out;
}

.navbar.sticky-top.scrolled {
    background-color: rgba(var(--bs-dark-rgb), 0.85) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}


.footer.bg-light {
    background-color: #f1f3f5 !important;
    border-top: 1px solid #dee2e6;
}


/* 3. Typography & Special Effects */
.display-5, .display-6 {
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(90deg, #4f46e5, #c026d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}


/* 4. Hero Visual Styling */
@keyframes kenburns {
    0% { transform: scale(1.05) translateX(-1%) translateY(1%); }
    100% { transform: scale(1.25) translateX(2%) translateY(-2%); }
}

.hero-visual-container {
    position: relative;
    overflow: hidden;
    background-color: rgb(var(--bs-dark-rgb));
}

.hero-visual-container::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(rgba(var(--bs-dark-rgb), 0.7), rgba(var(--bs-dark-rgb), 0.7)), url('../img/hero/hero03-01.webp');
    animation: kenburns 40s ease-in-out infinite alternate;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #f8f9fa;
}
.hero-content .lead {
    color: rgba(248, 249, 250, 0.75);
}
.hero-content .btn-outline-secondary {
    --bs-btn-color: #f8f9fa;
    --bs-btn-border-color: #f8f9fa;
    --bs-btn-hover-bg: #f8f9fa;
    --bs-btn-hover-color: rgb(var(--bs-dark-rgb));
}


/* 5. Card & List Group Styling */
.card {
    border: 1px solid transparent;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* THE FIX: Override the hover effect for the filter card */
#filter-card:hover {
    transform: none; /* remove the movement */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important; /* keep the shadow */
}

.sponsorship-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    font-size: 0.75em;
    font-weight: 700;
    padding: .35em .65em;
    border-radius: .25rem;
    line-height: 1;
}

.sponsor-gold { border: 2px solid var(--bs-warning) !important; }
.sponsor-gold .sponsorship-badge { background-color: var(--bs-warning); color: var(--bs-dark); }
.sponsor-gold .sponsorship-badge::before { content: 'Featured'; }

.sponsor-silver { border: 2px solid var(--bs-info) !important; }
.sponsor-silver .sponsorship-badge { background-color: var(--bs-info); color: var(--bs-dark); }
.sponsor-silver .sponsorship-badge::before { content: 'Promoted'; }

.sponsor-bronze { border: 2px solid var(--bs-light-grey) !important; }
.sponsor-bronze .sponsorship-badge { background-color: #f8f9fa; color: #495057; border: 1px solid var(--bs-light-grey); }
.sponsor-bronze .sponsorship-badge::before { content: 'Sponsored'; }

.favorite-toggle {
    position: relative;
    z-index: 2;
}

.list-group-item {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.list-group-item-action:hover {
    transform: translateX(5px);
    box-shadow: -5px 5px 10px rgba(0,0,0, .05);
    background-color: #fff;
    z-index: 10;
}


/* 6. Button & Form Overrides */
.btn {
    font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: #4f46e5;
    --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
}

.form-control:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}


/* 7. Star Rating */
.rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.rating > input{ display:none; }
.rating > label { position: relative; width: 1.5em; font-size: 2rem; color: #FFD700; cursor: pointer; }
.rating > label::before { content: '\2606'; position: absolute; left: 0; }
.rating > label:hover::before, .rating > label:hover ~ label::before, .rating > input:checked ~ label::before { content: '\2605'; }
.rating-display .bi-star-fill, .rating-display .bi-star { color: #FFD700; }
.rating-input-group { position: relative; height: 40px; }


/* 8. Content Body */
.content-body h2, .content-body h3, .content-body h4 { margin-top: 1.5rem; margin-bottom: 1rem; font-weight: 600; }
.content-body p { line-height: 1.6; margin-bottom: 1rem; }
.content-body ul, .content-body ol { padding-left: 2rem; margin-bottom: 1rem; }
.content-body img { max-width: 100%; height: auto; border-radius: 0.25rem; margin-top: 0.5rem; margin-bottom: 1rem; }


/* 9. Back to Top Button */
#backToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 20px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    cursor: pointer;
    background-color: rgba(var(--bs-primary-rgb), 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease-out, visibility 0.4s ease-out;
    transform: translateY(80px);
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#backToTopBtn:hover {
    background-color: rgb(var(--bs-primary-rgb));
    transform: translateY(-5px);
}

#backToTopBtn.show {
    visibility: visible;
    transform: translateY(0);
    opacity: 1;
}

/* --- 10. Shortcode CTA Card Styles --- */
.sc-cta-card {
    position: relative;
    background-color: #151826;
    border: 1px solid #343a40;
    border-radius: 0.75rem;
    padding: 2.5rem;
    margin: 3rem 0;
    text-align: center;
    overflow: hidden;
}
.sc-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: sc-pan-background 45s linear infinite;
    z-index: 0;
}
@keyframes sc-pan-background {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}
.sc-cta-card > * {
    position: relative;
    z-index: 1;
}
.sc-cta-card .gradient-bar {
    position: relative;
    height: 8px;
    width: 60%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    border-radius: 5px;
    margin: 0 auto 1.5rem auto;
    overflow: hidden;
}
.sc-cta-card .gradient-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shimmer 4s infinite linear;
}
@keyframes shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}
.sc-cta-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.75rem;
    color: #fff;
}
.sc-cta-card p {
    color: #adb5bd;
    margin-bottom: 2rem;
    font-size: 1.0rem;
    max-width: 600px;
    line-height: 1.6;
    margin-left: auto;
    margin-right: auto;
}
.sc-cta-card .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 500;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    border: none;
    color: white;
    transition: all 0.2s ease-in-out;
}
.sc-cta-card .btn:hover {
    color: white;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

/* --- 11. Newsletter CTA Card --- */
.newsletter-cta-card {
    position: relative;
    background-color: rgb(var(--bs-dark-rgb));
    color: #f8f9fa;
    padding: 3rem;
    border-radius: 1rem;
    overflow: hidden;
}

.newsletter-cta-card::after {
    content: '';
    position: absolute;
    top: -100px;
    right: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.2), transparent 70%);
    pointer-events: none;
}

.newsletter-cta-card .newsletter-title {
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.newsletter-cta-card .newsletter-text {
    color: #adb5bd;
    max-width: 450px;
}
.newsletter-cta-card .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 0.75rem 1.25rem;
}
.newsletter-cta-card .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0.75rem 1.5rem;
}
#footer-alert-container {
    min-height: 50px;
}
#footer-alert-container .alert {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    text-align: left;
    margin-bottom: 0;
}
#footer-alert-container .alert .btn-close {
    padding: 0.5rem;
    margin: auto 0;
}

@media (max-width: 991.98px) {
    .newsletter-cta-card .newsletter-title,
    .newsletter-cta-card .newsletter-text {
        text-align: center;
    }
    .newsletter-cta-card .newsletter-text {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 2rem;
    }
    .newsletter-cta-card .input-group {
        flex-direction: column;
    }
    .newsletter-cta-card .form-control {
        width: 100%;
        border-radius: var(--bs-border-radius-lg) !important;
    }
    .newsletter-cta-card .btn {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: var(--bs-border-radius-lg) !important;
    }
}

/* --- 12. Deal & Promo Code Styles --- */
.promo-code-display {
    display: inline-block;
    border: 1px dashed var(--bs-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 0.25rem;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: var(--bs-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}
.promo-code-display:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
}
.promo-code-display.copied {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
    color: #0f5132;
}

.promo-code-wrapper {
    display: inline-block;
    border: 2px dashed #198754;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    background-color: #e9f5ec;
}
.promo-code-text {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #0f5132;
}