/* ---------- Header search (home page only) ---------- */

/* The app header's own mobile search bar duplicates the hero search below it
   at every width where the header switches to its mobile layout (< xl), so
   it's hidden here - scoped to this stylesheet, which only loads on '/'. */
@media (max-width: 1199.98px) {
    .app-header-mobile-search-form {
        display: none !important;
    }
}

/* ---------- Hero ---------- */

.home-hero {
    overflow: hidden;
    position: relative;
    padding: 64px 40px 40px;
    text-align: center;
    background: linear-gradient(135deg, #0f79f3 0%, #796df6 100%);
}

.home-hero::before,
.home-hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.home-hero::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -80px;
}

.home-hero::after {
    width: 220px;
    height: 220px;
    bottom: -100px;
    left: -60px;
}

.home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.home-hero-title {
    margin-top: 20px;
    color: #ffffff;
    font-weight: 600;
}

.home-hero-subtitle {
    margin: 12px auto 0;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 17px;
    line-height: 1.6;
}

/* ---------- Hero search ---------- */

.home-hero-search {
    max-width: 560px;
    margin: 32px auto 0;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
}

.home-hero-search-icon {
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    flex-shrink: 0;
}

.home-hero-search-input {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
    padding: 10px 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-hero-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.home-hero-search-btn {
    flex-shrink: 0;
    border-radius: 50px !important;
    padding: 10px 24px;
}

.home-hero-search .pharmacy-search-results {
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    text-align: left;
}

/* ---------- Hero actions & stats ---------- */

.home-hero-actions {
    margin-top: 24px;
}

.home-hero-actions .btn {
    padding: 10px 28px;
}

.home-hero-stats {
    margin-top: 40px;
    gap: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.home-hero-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
}

.home-hero-stat-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.home-hero-stat-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin-top: 2px;
}

@media (max-width: 575px) {
    .home-hero {
        padding: 48px 20px 32px;
    }

    .home-hero-actions .btn {
        width: 100%;
    }

    .home-hero-search {
        border-radius: 50px;
        padding: 6px 6px 6px 14px;
    }

    .home-hero-search-input {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 8px;
    }

    .home-hero-search-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        white-space: nowrap;
    }

    .home-hero-stats {
        gap: 20px 32px;
    }
}

/* ---------- Section heading ---------- */

.home-section-heading h2 {
    color: #1e293b;
}

/* ---------- Feature cards ---------- */

.home-feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.home-feature-icon {
    width: 52px;
    height: 52px;
}

/* ---------- Leaderboards ---------- */

.home-leaderboard-tabs .nav-link {
    border-radius: 50px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
}

.home-leaderboard-tabs .nav-link.active {
    background-color: #0f79f3;
    color: #ffffff;
}

.home-leaderboard-row {
    padding: 12px 4px;
    border-bottom: 1px solid #eeeeee;
    color: inherit;
}

.home-leaderboard-row:last-child {
    border-bottom: none;
}

.home-leaderboard-row:hover .home-leaderboard-name {
    color: #0f79f3;
}

.home-leaderboard-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f4f6fc;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.home-leaderboard-rank-1 {
    background: #fdf1d8;
    color: #b8860b;
}

.home-leaderboard-rank-2 {
    background: #eef1f5;
    color: #6b7280;
}

.home-leaderboard-rank-3 {
    background: #fbe8dd;
    color: #b3541e;
}

.home-leaderboard-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    transition: color 0.15s ease;
}

.home-leaderboard-postcode {
    font-size: 12px;
    color: #919aa3;
}

.home-leaderboard-value {
    font-size: 15px;
    font-weight: 600;
    color: #0f79f3;
    white-space: nowrap;
}

/* ---------- CTA banner ---------- */

.home-cta-banner {
    padding: 32px 36px;
    background: linear-gradient(135deg, #475569 0%, #2b2a3f 100%);
}

@media (max-width: 575px) {
    .home-cta-banner {
        padding: 24px;
        text-align: center;
        justify-content: center !important;
    }
}

/* ---------- Dark mode ---------- */

[data-theme="dark"] .home-section-heading h2 {
    color: #ffffff;
}

[data-theme="dark"] .home-leaderboard-row {
    border-bottom-color: #ffffff17;
}

[data-theme="dark"] .home-leaderboard-name {
    color: #ffffff;
}

[data-theme="dark"] .home-leaderboard-rank {
    background: #ffffff17;
    color: #ffffff80;
}
