/* ============================================================
   HomeCare Connect — Homepage Stylesheet
   Mobile-first design for the public homepage
   ============================================================ */

:root {
    --hc-primary: #0d6efd;
    --hc-secondary: #198754;
    --hc-accent: #0dcaf0;
    --hc-danger: #dc3545;
    --hc-light: #f8f9fa;
    --hc-dark: #212529;
    --hc-gradient: linear-gradient(135deg, var(--hc-primary) 0%, var(--hc-secondary) 100%);
    --home-hero-height: 70vh;
    --home-hero-height-sm: 55vh;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar-home {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    z-index: 1030;
}
.navbar-home.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}
.navbar-home .navbar-brand,
.navbar-home .nav-link,
.navbar-home .navbar-toggler-icon {
    color: var(--hc-dark) !important;
}
.navbar-home .btn-danger {
    color: #fff !important;
}
.navbar-home .navbar-toggler-icon {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 30 2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h30v2H0z' fill='%230d6efd'/%3E%3C/svg%3E") repeat;
    border-radius: 4px;
}
.navbar-home .navbar-toggler {
    border-color: rgba(13, 110, 253, 0.5);
}

/* ── Nav Links (dark on light navbar) ───────────────────────── */
.navbar-nav .nav-link {
    color: var(--hc-dark) !important;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0 !important;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--hc-primary) !important;
}
.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--hc-danger);
}

/* ── Hero Slideshow ──────────────────────────────────────────── */
.hero-carousel {
    position: relative;
    overflow: hidden;
    min-height: var(--home-hero-height-sm);
    height: var(--home-hero-height);
    background: linear-gradient(135deg, var(--hc-primary) 0%, var(--hc-secondary) 100%);
}
.hero-carousel .hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
    display: flex;
    align-items: center;
}
.hero-carousel .hero-slide.active {
    opacity: 1;
    visibility: visible;
    display: flex;
    align-items: center;
}
.hero-carousel .hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.45) 0%, rgba(25, 135, 84, 0.45) 100%);
    z-index: 1;
}
.hero-carousel .hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-carousel .hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 720px;
}
.hero-carousel .hero-content h1 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.hero-carousel .hero-content p {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 600px;
}

/* Hero carousel controls */
.hero-nav-btn {
    position: absolute;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--hc-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 3;
}
.hero-nav-btn:hover {
    background: #fff;
}
.hero-nav-prev { left: 16px; }
.hero-nav-next { right: 16px; }

/* Slide indicators */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}
.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.hero-indicator.active,
.hero-indicator:hover {
    background: var(--hc-danger);
}

/* ── Section: Why Choose ──────────────────────────────────────── */
.section-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--hc-primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}
.section-title .text-gradient {
    background: var(--hc-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.6;
}

/* ── Services Grid ──────────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.service-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--hc-primary);
}
.service-card .service-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(25, 135, 84, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--hc-primary);
    margin-bottom: 1.25rem;
}
.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.service-card p {
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}
.service-card .btn-learn {
    color: var(--hc-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 1rem;
}
.service-card .btn-learn:hover {
    color: var(--hc-secondary);
    transform: translateX(4px);
}

/* ── Benefits Section ────────────────────────────────────────── */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.benefit-item {
    text-align: center;
    padding: 1.5rem;
}
.benefit-item .benefit-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--hc-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.75rem;
}
.benefit-item h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.benefit-item p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Trust Bar ───────────────────────────────────────────────── */
.trust-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0.7;
}
.trust-bar .trust-item {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.trust-bar .trust-stars {
    color: #ffc107;
    font-size: 1rem;
}

/* ── CTA Section ─────────────────────────────────────────────── */
.cta-section {
    background: var(--hc-gradient);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    color: #fff;
    margin: 2rem 0;
}
.cta-section .cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.cta-section .cta-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}
.cta-section .btn-cta {
    background: #fff;
    color: var(--hc-primary);
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cta-section .btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ── Home Footer ─────────────────────────────────────────────── */
.home-footer {
    background: #1a2a3a;
    color: #adb5bd;
}
.home-footer a.footer-link {
    color: #c8d6e5;
    text-decoration: none;
    transition: color 0.2s;
}
.home-footer a.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}
.home-footer h6 {
    color: #fff;
}
.home-footer .border-top {
    border-color: #2d3e50 !important;
}

/* ── Section Spacing ─────────────────────────────────────────── */
.section-py {
    padding: 4rem 0;
}
.section-py-sm {
    padding: 2.5rem 0;
}

/* ── Mobile First ────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .hero-carousel {
        min-height: var(--home-hero-height-sm);
        height: var(--home-hero-height-sm);
    }
    .hero-carousel .hero-content h1 {
        font-size: 1.75rem;
    }
    .hero-carousel .hero-content p {
        font-size: 1rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .cta-section {
        padding: 2rem 1rem;
    }
    .cta-section .cta-title {
        font-size: 1.5rem;
    }
    .section-py {
        padding: 3rem 0;
    }
    .section-py-sm {
        padding: 2rem 0;
    }
}

@media (max-width: 575.98px) {
    .hero-carousel .hero-content {
        max-width: 100%;
    }
    .hero-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Go to Top Button ────────────────────────────────────────── */
.go-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--hc-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease;
    z-index: 9999;
}
.go-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.go-top-btn:hover {
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-secondary));
    transform: scale(1.05);
}

@media (max-width: 575.98px) {
    .go-top-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}
