/* 
 * JM Home Nursing - Clean, Premium Modern Stylesheet 
 * Refactored to eliminate redundant overrides and implement conversion-focused UI elements.
 */

:root {
    --primary-color: #1b4332;       /* Deep Forest Green */
    --primary-light: #2d6a4f;      /* Medium Forest Green */
    --primary-dark: #081c15;       /* Very Dark Green */
    --secondary-color: #f4f9f5;     /* Warm Sage Pale Background */
    --accent-color: #d4a373;        /* Soft Warm Sand/Gold for Highlights */
    --accent-gold: #c9a227;         /* Bright Trust Gold for Stars/Badges */
    --accent-red: #c92a2a;          /* Emergency / Highlight Red */
    --whatsapp-color: #25d366;      /* Official WhatsApp Green */
    
    --text-dark: #17211b;          /* Soft Black with green tint */
    --text-muted: #5e6b62;         /* Grayish Green for body paragraph */
    --text-light: #ffffff;
    
    --bg-light: #fafbf9;           /* Off-white background */
    --surface: #ffffff;            /* White card background */
    --border: #e3e8e2;             /* Subtle divider color */
    
    --shadow-soft: 0 1rem 2.5rem rgba(8, 28, 21, 0.05);
    --shadow-card: 0 0.5rem 1.5rem rgba(8, 28, 21, 0.04);
    --shadow-pop: 0 1rem 3rem rgba(8, 28, 21, 0.12);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* Global Reset & Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    line-height: 1.65;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

p.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Common Layout Components */
.container {
    width: min(92%, 1200px);
    margin: 0 auto;
}

.section-padding {
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.text-center {
    text-align: center;
}

.section-title {
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title.left::after {
    left: 0;
    transform: none;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(227, 232, 226, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
}

header.sticky {
    box-shadow: var(--shadow-soft);
    background: rgba(255, 255, 255, 0.95);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 4.75rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary-light);
    margin-left: 0.25rem;
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links a:not(.btn) {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).active {
    color: var(--primary-dark);
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    bottom: 0;
    left: 0;
    transition: var(--transition);
}

.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).active::after {
    width: 100%;
}

.hamburger {
    background: transparent;
    border: 0;
    display: none;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 1001;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-dark);
    transition: var(--transition);
}

/* Call-to-Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light) !important;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 0.5rem 1.5rem rgba(27, 67, 50, 0.25);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary-dark) !important;
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background-color: var(--whatsapp-color);
    color: var(--text-light) !important;
}

.btn-whatsapp:hover {
    background-color: #1ebd56;
    box-shadow: 0 0.5rem 1.5rem rgba(37, 211, 102, 0.25);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--accent-red);
    color: var(--text-light) !important;
}

.btn-danger:hover {
    background-color: #ad2020;
    box-shadow: 0 0.5rem 1.5rem rgba(201, 42, 42, 0.25);
    transform: translateY(-2px);
}

/* Hero Section */
#hero {
    min-height: calc(100vh - 4.75rem);
    height: auto;
    padding: clamp(3rem, 6vw, 6rem) 0;
    background: linear-gradient(125deg, #f3f8f4 0%, #e8f3ea 50%, #ffffff 100%);
    display: flex;
    align-items: center;
}

.hero-split {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.hero-copy {
    grid-column: span 6;
}

.hero-copy .eyebrow {
    color: var(--primary-light);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin-bottom: 1.25rem;
    color: var(--primary-dark);
}

.hero-copy p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

/* Trust Badges - Below Hero Content */
.hero-trust-badges {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(27, 67, 50, 0.1);
    padding-top: 1.5rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.trust-badge i {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.hero-media {
    grid-column: span 6;
    position: relative;
}

.hero-media img {
    border-radius: 1.5rem;
    box-shadow: var(--shadow-pop);
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.hero-media::after {
    content: '24/7 Verified Care';
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-card);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Page Headers */
.page-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
    padding: 4.5rem 0;
    text-align: center;
}

.page-header h1 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.page-header p {
    max-width: 60ch;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Feature & Service Card Grids */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

/* Services Page Card Items */
.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-item {
    background: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-light);
}

.service-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.service-item:hover img {
    transform: scale(1.03);
}

.service-item-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-item h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

.service-item p {
    flex-grow: 1;
}

.service-link {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.service-link:hover {
    color: var(--primary-light);
    gap: 0.5rem;
}

/* Dynamic Service Page Layouts (Specific UI Palettes) */
/* Elderly Care Page Specific */
.elderly-theme {
    --primary-color: #2b4c3f;
    --primary-light: #446d5c;
    --secondary-color: #f7faf9;
}

/* Critical Care Page Specific */
.critical-theme {
    --primary-color: #1e3a5f;
    --primary-light: #2b5c8f;
    --secondary-color: #f4f7fa;
}

/* Baby Care Page Specific */
.baby-theme {
    --primary-color: #5c6b73;
    --primary-light: #93b5c6;
    --secondary-color: #f9fbfb;
}

.baby-theme h1, .baby-theme h2, .baby-theme h3 {
    font-weight: 600;
}

/* Info Detail Sections (Split layout) */
.split-section {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: 3.5rem;
}

.split-media {
    grid-column: span 6;
}

.split-media img {
    border-radius: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.split-content {
    grid-column: span 6;
}

.check-list {
    margin: 1.5rem 0 2rem 0;
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.check-list li i {
    color: var(--primary-light);
    margin-top: 4px;
}

/* Testimonials / Review Widgets */
.testimonial-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    border-top: 4px solid var(--primary-light);
}

.testimonial-card .stars {
    color: var(--accent-gold);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.client-meta h4 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.client-meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Trust Signals Section (Staff Credentials) */
.qualifications-bar {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 3rem 0;
    border-radius: 1rem;
    text-align: center;
    margin-top: 2rem;
}

.qualifications-bar h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.qual-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.qual-item {
    font-weight: 700;
    font-size: 1.25rem;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

/* Floating Contact & Call Actions (Panic CTA buttons) */
.floating-ctas {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}

.float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    box-shadow: var(--shadow-pop);
    transition: var(--transition);
    font-size: 1.5rem;
}

.float-btn:hover {
    transform: scale(1.1) translateY(-3px);
}

.float-whatsapp {
    background-color: var(--whatsapp-color);
}

.float-call {
    background-color: var(--accent-red);
}

/* Mobile Sticky Action Bar - Bottom of viewport on phones */
.mobile-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -0.5rem 2rem rgba(8, 28, 21, 0.1);
    display: none; /* Controlled by Media Query */
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    z-index: 1000;
}

.mobile-sticky-bar .btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='file'],
select,
textarea {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border);
    background-color: #fafbfc;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light);
    background-color: var(--surface);
    box-shadow: 0 0.5rem 1.5rem rgba(27, 67, 50, 0.25);
}

.form-group small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-message {
    margin-top: 1.25rem;
    font-weight: 600;
    text-align: center;
}

/* Footer Section */
footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.75);
    padding: 5rem 0 2rem 0;
    font-size: 0.925rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3.5rem;
    margin-bottom: 4rem;
}

.footer-col h3 {
    color: var(--text-light);
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
}

.footer-brand p {
    margin-top: 1rem;
    line-height: 1.7;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contact-item i {
    color: var(--accent-color);
    margin-top: 4px;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
}

.footer-links a:hover {
    color: var(--text-light);
    padding-left: 4px;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.footer-socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
}

.footer-socials a:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.map-container {
    height: 180px;
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0.5rem;
}

.footer-bottom a:hover {
    color: var(--text-light);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    animation: fadeInUp 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {
    .hero-split {
        gap: 2rem;
    }
    .qual-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 4.75rem;
        flex-direction: column;
        background-color: var(--surface);
        width: 100%;
        height: calc(100vh - 4.75rem);
        text-align: center;
        gap: 2rem;
        padding: 3rem 0;
        box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.1);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a:not(.btn) {
        display: block;
        font-size: 1.15rem;
    }
    
    .nav-links .btn {
        width: 80%;
        margin: 0 auto;
    }

    .hero-split {
        grid-template-columns: 1fr;
    }

    .hero-copy, .hero-media {
        grid-column: auto;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .split-section {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .split-media, .split-content {
        grid-column: auto;
    }

    .qual-grid {
        flex-direction: column;
        align-items: center;
    }

    .qual-item {
        width: 80%;
    }

    /* Show Sticky Bottom Bar & Hide Floating CTAs */
    .mobile-sticky-bar {
        display: grid;
    }
    
    .floating-ctas {
        bottom: 5.5rem;
        right: 1.25rem;
    }
    
    /* Make sure space is padded at the bottom so footer content isn't covered */
    body {
        padding-bottom: 4.75rem;
    }
}