/* SupportGrove Custom Styles */

:root {
    /* Color Palette */
    --grove-green: #4A7C59;
    --soft-sage: #8FBC8F;
    --warm-cream: #F5F5DC;
    --gentle-blue: #87CEEB;
    --lavender: #E6E6FA;
    --soft-coral: #FFB6C1;
    --deep-forest: #2F4F2F;
    --golden-yellow: #FFD700;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Merriweather', serif;
    
    /* Spacing & Sizing */
    --border-radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* Prevent horizontal overflow and unwanted scrollbars */
html, body {
    width: 100%;
}

/* Prevent scrollbars in common elements */
.navbar, .navbar-nav, .nav-item, .nav-link,
section, .container, .row, .col,
[class*="col-"], .card, .card-body {
    overflow: visible;
}

/* Only allow overflow on specific elements that need it */
.hero-image-container {
    overflow: hidden;
}

.story-card {
    overflow: hidden;
}

.container, .container-fluid {
    width: 100%;
    max-width: 100%;
}

/* Ensure Bootstrap rows don't cause horizontal overflow */
.row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.row > * {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* Prevent any element from extending beyond viewport */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Mobile navigation styles */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        margin-top: 0.5rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-md);
        padding: 1rem 1.5rem;
    }
    
    /* Floating navbar mobile */
    .floating-navbar {
        margin: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    .floating-navbar .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.75rem;
        border-radius: 12px;
        padding: 1rem;
    }
}

/* Desktop navigation - hide hamburger menu */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
    }
    
    /* Prevent scrollbars in navigation */
    .navbar, .navbar-collapse {
        overflow: visible;
    }
    
    /* Ensure sections don't show scrollbars */
    section, .container, .row, .col-lg-6, .col-md-6, .col-sm-6 {
        overflow: visible;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.font-merriweather {
    font-family: var(--font-secondary);
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* Color Classes */
.text-grove-green { color: var(--grove-green) !important; }
.text-soft-sage { color: var(--soft-sage) !important; }
.text-warm-cream { color: var(--warm-cream) !important; }
.text-gentle-blue { color: var(--gentle-blue) !important; }
.text-lavender { color: var(--lavender) !important; }
.text-soft-coral { color: var(--soft-coral) !important; }
.text-deep-forest { color: var(--deep-forest) !important; }
.text-golden-yellow { color: var(--golden-yellow) !important; }

.bg-grove-green { background-color: var(--grove-green) !important; }
.bg-soft-sage { background-color: var(--soft-sage) !important; }
.bg-warm-cream { background-color: var(--warm-cream) !important; }
.bg-gentle-blue { background-color: var(--gentle-blue) !important; }
.bg-lavender { background-color: var(--lavender) !important; }
.bg-soft-coral { background-color: var(--soft-coral) !important; }
.bg-deep-forest { background-color: var(--deep-forest) !important; }
.bg-golden-yellow { background-color: var(--golden-yellow) !important; }

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-grove-green {
    background-color: var(--grove-green);
    border-color: var(--grove-green);
    color: white;
}

.btn-grove-green:hover,
.btn-grove-green:focus {
    background-color: var(--deep-forest);
    border-color: var(--deep-forest);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-grove-green {
    border: 2px solid var(--grove-green);
    color: var(--grove-green);
    background-color: transparent;
}

.btn-outline-grove-green:hover,
.btn-outline-grove-green:focus {
    background-color: var(--grove-green);
    border-color: var(--grove-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Glass morphism buttons for hero section */
.hero-section .btn {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-section .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.hero-section .btn:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Override specific button styles in hero section */
.hero-section .btn-grove-green {
    background: rgba(74, 124, 89, 0.8);
    border-color: rgba(74, 124, 89, 0.9);
    color: white;
}

.hero-section .btn-grove-green:hover {
    background: rgba(74, 124, 89, 0.9);
    border-color: rgba(74, 124, 89, 1);
    color: white;
}

.hero-section .btn-outline-grove-green {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.hero-section .btn-outline-grove-green:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* White glass button for floating navbar */
.btn-white-glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--grove-green);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-white-glass:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--grove-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.rounded-pill {
    border-radius: 50rem !important;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    transition: var(--transition);
    padding: 1rem 0;
    z-index: 1030; /* Ensure navbar is above other content */
    overflow: visible; /* Prevent scrollbars in navbar */
}

/* Floating Navbar */
.floating-navbar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin: 1rem;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-navbar:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.floating-navbar .container {
    max-width: 1200px;
    padding: 0 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--grove-green) !important;
}

/* Floating navbar brand */
.floating-navbar .navbar-brand {
    color: #4CAF50 !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: #666 !important;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--grove-green) !important;
}

/* Floating navbar links */
.floating-navbar .navbar-nav .nav-link {
    color: #4CAF50 !important;
    font-weight: 500;
}

.floating-navbar .navbar-nav .nav-link:hover,
.floating-navbar .navbar-nav .nav-link.active {
    color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--grove-green);
    transition: var(--transition);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Custom hamburger icon (fallback if Font Awesome doesn't load) */
.navbar-toggler-icon {
    background-image: none;
    width: 24px;
    height: 18px;
    position: relative;
    display: block;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after,
.navbar-toggler-icon {
    background-color: var(--grove-green);
    height: 2px;
    transition: all 0.3s ease;
}

/* Floating navbar hamburger */
.floating-navbar .navbar-toggler-icon::before,
.floating-navbar .navbar-toggler-icon::after,
.floating-navbar .navbar-toggler-icon {
    background-color: #4CAF50;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    left: 0;
}

.navbar-toggler-icon::before {
    top: -6px;
}

.navbar-toggler-icon::after {
    top: 6px;
}

/* Hamburger animation on collapse */
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-color: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    transform: rotate(45deg) translate(0, 6px);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    transform: rotate(-45deg) translate(0, -6px);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    position: relative;
    background: transparent;
    padding-top: 0; /* Remove top padding */
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Add extra padding for non-home pages */
body:not(.home-page) .hero-section {
    padding-top: 130px; /* 80px navbar + 50px extra spacing */
}

.hero-bg {
    background: url('/images/cover.jpeg') center/cover no-repeat;
    opacity: 1;
    z-index: 1;
    width: 100vw;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.z-index-2 {
    z-index: 2;
}

.hero-image-container {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.hero-image-container img {
    border-radius: var(--border-radius);
    transition: transform 0.6s ease-in-out;
}

.hero-image-container:hover img {
    transform: scale(1.02) translateY(-5px);
    animation: heroImageFloat 2s ease-in-out infinite;
}

/* Hero image floating animation */
@keyframes heroImageFloat {
    0%, 100% { 
        transform: scale(1.02) translateY(-5px); 
    }
    50% { 
        transform: scale(1.02) translateY(-15px); 
    }
}

/* Trust Message Styles */
.trust-message-container {
    margin-top: 1.5rem;
}

.trust-item {
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

.trust-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    backdrop-filter: blur(10px);
}

.trust-item i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.trust-item span {
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Mobile trust items - icon on top, text below */
@media (max-width: 767.98px) {
    .trust-message-mobile .trust-item {
        padding: 0.25rem 0.25rem;
        min-width: 60px;
    }
    
    .trust-message-mobile .trust-item i {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    .trust-message-mobile .trust-item span {
        font-size: 0.7rem;
        line-height: 1.1;
    }
}

/* Desktop trust items - icon leading text */
@media (min-width: 768px) {
    .trust-message-desktop .trust-item {
        padding: 0.25rem 0.75rem;
    }
    
    .trust-message-desktop .trust-item i {
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }
    
    .trust-message-desktop .trust-item span {
        font-size: 0.8rem;
    }
}

.floating-card {
    bottom: 10px;
    right: 10px;
    animation: float 3s ease-in-out infinite;
    max-width: calc(100% - 20px);
    z-index: 10; /* Ensure floating card stays above image */
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Avatar images are now handled via Pravatar service */

/* Trust Indicators */
.trust-indicator {
    padding: 2rem 1rem;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.trust-indicator:hover {
    transform: translateY(-5px);
    background-color: white;
    box-shadow: var(--shadow-md);
}

/* Story Cards */
.story-card {
    transition: var(--transition);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Story avatars are now handled via Pravatar service */

/* Step Icons */
.step-icon {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.step-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Cards */
.card {
    border-radius: var(--border-radius);
    border: none;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--grove-green);
    box-shadow: 0 0 0 0.2rem rgba(74, 124, 89, 0.25);
}

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.min-vh-100 {
    min-height: 100vh;
}

.shadow-soft {
    box-shadow: var(--shadow-sm);
}

.rounded-4 {
    border-radius: 1rem;
}

/* Social Links */
.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--grove-green) !important;
    transform: translateY(-2px);
}

/* Footer Styling */
footer.bg-dark .text-muted {
    color: #adb5bd !important;
}

footer.bg-dark .text-muted:hover {
    color: white !important;
}

footer.bg-dark .social-links a {
    color: #adb5bd !important;
}

/* Modal Customizations */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background-color: var(--warm-cream);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: var(--border-radius);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 0;
        padding-left: 0;
        padding-right: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100vw;
        overflow-x: hidden;
    }
    
    .hero-bg {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Reset all hero section columns - no spacing by default */
    .hero-section .col-lg-6 {
        margin-top: 0;
        padding-top: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* All pages now use hero-image-container - no need for direct image spacing */
    
    /* Home page override: Remove ALL spacing for hero image container */
    .hero-section .hero-image-container,
    .hero-section .col-lg-6 .hero-image-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    
    /* Center align content on mobile */
    .hero-section .col-lg-6:first-child {
        text-align: center;
    }
    
    .hero-section h1,
    .hero-section .lead,
    .hero-section p {
        text-align: center;
    }
    
    /* Mobile anonymous section layout */
    .anonymous-section {
        flex-direction: column;
        text-align: center;
        align-items: center;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Reduce hero image animation intensity on mobile */
    @media (max-width: 768px) {
        .hero-image-container:hover img {
            transform: scale(1.01) translateY(-3px);
        }
        
        @keyframes heroImageFloat {
            0%, 100% { 
                transform: scale(1.01) translateY(-3px); 
            }
            50% { 
                transform: scale(1.01) translateY(-8px); 
            }
        }
    }
    
    .anonymous-desktop {
        display: none !important;
    }
    
    .anonymous-mobile {
        display: block !important;
        text-align: center;
        line-height: 1.6;
    }
    
    .anonymous-mobile .d-block {
        margin-bottom: 0.25rem;
    }
    
    .anonymous-mobile .d-block:last-child {
        margin-bottom: 0;
    }
    
    .anonymous-icon {
        margin-bottom: 0.75rem;
        margin-right: 0 !important;
        font-size: 1.5rem;
    }
    
    /* Center buttons on mobile */
    .hero-section .btn,
    .hero-section .d-flex {
        justify-content: center;
        text-align: center;
    }
    
    .hero-section .d-flex.align-items-center {
        justify-content: center;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .floating-card {
        position: static;
        margin-top: 0.75rem;
        margin-left: auto;
        margin-right: auto;
        max-width: calc(100% - 2rem);
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(74, 124, 89, 0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(74, 124, 89, 0.05);
        border-radius: 0.5rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* General mobile text and button centering for all sections */
    .text-center-mobile {
        text-align: center !important;
    }
    
    /* Center align all buttons on mobile */
    .btn:not(.navbar-nav .btn) {
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0.5rem;
    }
    
    /* Center align button groups */
    .d-flex.gap-3,
    .d-flex.flex-column.flex-sm-row.gap-3,
    .d-flex.flex-column.flex-sm-row.justify-content-center.gap-3 {
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    
    /* Ensure hero section buttons are centered on mobile */
    .hero-section .d-flex.flex-column.flex-sm-row.gap-3.justify-content-center {
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
    }
    
    .hero-section .d-flex.flex-column.flex-sm-row.gap-3.justify-content-center .btn {
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Center align buttons in text-center containers */
    .text-center .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Multiple buttons side by side on mobile - stack them */
    .text-center .btn + .btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    /* Trust message mobile styles */
    .trust-message-container {
        margin-top: 1.5rem;
        text-align: center;
    }
    
    .trust-message-mobile {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .trust-item {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        justify-content: center;
        text-align: center;
    }
    
    .trust-item i {
        font-size: 1rem;
        width: 18px;
        flex-shrink: 0;
    }
    
    .trust-item span {
        text-align: center;
    }
    
    /* Ensure hamburger menu is immediately visible on mobile */
    .navbar-toggler {
        opacity: 1;
        visibility: visible;
        display: flex !important;
    }
    
    /* Crisis FAB removed - AI chat provides crisis support */
    
    /* Ensure floating card doesn't cause overflow on mobile */
    .floating-card {
        position: static !important;
        margin-top: 1rem !important;
        right: auto !important;
        bottom: auto !important;
        max-width: 100% !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }
    
    .hero-section {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Extra small mobile - tighter spacing for hero images */
    .hero-section .col-lg-6:last-child {
        padding-top: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-top: 0;
    }
    
    /* Home page - zero spacing on small mobile */
    .hero-section .hero-image-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* All images now in hero-image-container - no direct image targeting needed */
    
    /* Better button centering on very small screens */
    .hero-section .btn-lg {
        display: block;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1rem;
    }
    
    .hero-section .d-flex.flex-column.flex-sm-row {
        align-items: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .story-card .card-body {
        padding: 1.5rem !important;
    }
    
    /* Force all elements to respect viewport width */
    * {
        box-sizing: border-box;
    }
    
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Enhanced mobile menu styling for very small screens */
    .navbar-collapse {
        padding: 0.75rem 1rem !important;
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
    }
    
    .navbar-nav .nav-link {
        font-size: 1rem !important;
        padding: 0.5rem 0 !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --grove-green: #2F4F2F;
        --soft-sage: #4A7C59;
    }
    
    .btn-grove-green {
        border: 2px solid var(--grove-green);
    }
    
    .card {
        border: 1px solid #ddd;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-card {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .floating-card {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero-section {
        min-height: auto;
        page-break-after: always;
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--grove-green);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus,
.navbar-brand:focus,
.navbar-nav .nav-link:focus,
.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Crisis FAB removed - AI chat provides crisis support */

/* Desktop-specific layout fixes */
@media (min-width: 992px) {
    .floating-card {
        bottom: 10px;
        right: 10px;
        max-width: 280px;
    }
    
    .hero-section {
        padding-top: 0; /* Remove padding for floating navbar */
        padding-bottom: 0;
        height: 100vh;
        min-height: 100vh;
    }
    
    /* Home page specific - fit exactly to screen */
    .home-page .hero-section {
        padding-top: 0;
        padding-bottom: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    .container {
        max-width: 1200px;
    }
    
    /* Ensure proper spacing for desktop */
    .navbar-nav .nav-link {
        margin: 0 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    /* Desktop crisis FAB removed - AI chat provides crisis support */
    
    /* Desktop anonymous section - horizontal layout */
    .anonymous-section {
        flex-direction: row !important;
        text-align: left !important;
        justify-content: flex-start !important;
    }
    
    .anonymous-desktop {
        display: inline !important;
    }
    
    .anonymous-mobile {
        display: none !important;
    }
    
    .anonymous-icon {
        margin-bottom: 0 !important;
        margin-right: 0.5rem !important;
        font-size: 1rem !important;
    }
}

/* Crisis FAB hover removed - AI chat provides crisis support */

/* Pulse animation removed - was for crisis button */

/* Custom Scrollbar - Only for main page scroll */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body::-webkit-scrollbar-thumb {
    background: var(--grove-green);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--deep-forest);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: transparent;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* AI Chat FAB Styles */
.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--grove-green);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab:hover {
    background: var(--deep-forest);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.4);
}

.chat-fab.active {
    background: var(--deep-forest);
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget.active {
    opacity: 1;
    pointer-events: all;
}

.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget.active .chat-container {
    transform: scale(1) translateY(0);
}

.chat-header {
    background: linear-gradient(135deg, var(--grove-green), var(--deep-forest));
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header h4 i {
    font-size: 20px;
}

.chat-status {
    display: flex;
    align-items: center;
    font-size: 13px;
    opacity: 0.9;
    padding: 4px 8px;
    border-radius: 12px;
    gap: 6px;
}

.status-text {
    order: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    order: 2;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

/* Welcome Inspiration Message */
.welcome-inspiration {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.inspiration-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--grove-green), var(--deep-forest));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.2);
}

.inspiration-icon i {
    font-size: 24px;
    color: white;
}

.welcome-inspiration h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--deep-forest);
    line-height: 1.3;
}

.welcome-inspiration p {
    margin: 0;
    font-size: 16px;
    color: #6c757d;
    line-height: 1.5;
    max-width: 400px;
}

/* Quick Start Templates */
.quick-templates-container {
    padding: 12px 20px 0 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    position: relative;
}

.quick-templates-container::before,
.quick-templates-container::after {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 30px;
    pointer-events: none;
    z-index: 2;
}

.quick-templates-container::before {
    left: 0;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 30%, 
        rgba(255, 255, 255, 0.4) 60%, 
        rgba(255, 255, 255, 0) 100%);
}

.quick-templates-container::after {
    right: 0;
    background: linear-gradient(to left, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 30%, 
        rgba(255, 255, 255, 0.4) 60%, 
        rgba(255, 255, 255, 0) 100%);
}

.quick-templates {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0 12px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    cursor: grab;
    user-select: none;
}

.quick-templates:active {
    cursor: grabbing;
}

.quick-templates::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.template-capsule {
    background: #e8f5e8;
    color: var(--deep-forest);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}

.template-capsule:hover {
    background: var(--grove-green);
    color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.template-capsule.crisis {
    background: #e8f5e8;
    color: var(--deep-forest);
}

.template-capsule.crisis:hover {
    background: var(--grove-green);
    color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.template-capsule.info {
    background: #e8f5e8;
    color: var(--deep-forest);
}

.template-capsule.info:hover {
    background: var(--grove-green);
    color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.user {
    background: linear-gradient(135deg, var(--grove-green), var(--deep-forest));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.chat-message.ai {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid #e9ecef;
}

.chat-message.system {
    background: var(--warm-cream);
    color: var(--deep-forest);
    align-self: center;
    font-size: 12px;
    font-style: italic;
    text-align: center;
    border-radius: 20px;
    max-width: 90%;
    border: 1px solid #e6d7c3;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: white;
    border-radius: 0 0 20px 20px;
}

.chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 48px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--grove-green);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.chat-send {
    background: linear-gradient(135deg, var(--grove-green), var(--deep-forest));
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.4);
}

.chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    max-width: 85%;
    align-self: flex-start;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
    }
    
    .chat-header {
        padding: 20px 20px 16px 20px;
        border-radius: 0;
        position: sticky;
        top: 0;
        z-index: 10;
        margin-top: 0;
    }
    
    .chat-header h4 {
        font-size: 18px;
    }
    
    .chat-status {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .chat-messages {
        padding: 16px;
        gap: 12px;
        padding-bottom: 100px; /* Space for input area */
    }
    
    .welcome-inspiration {
        padding: 30px 16px;
        margin: 16px 0;
    }
    
    .inspiration-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 16px;
    }
    
    .inspiration-icon i {
        font-size: 20px;
    }
    
    .welcome-inspiration h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .welcome-inspiration p {
        font-size: 14px;
    }
    
    .chat-message {
        max-width: 85%;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .quick-templates-container {
        padding: 8px 16px 0 16px;
        position: sticky;
        bottom: 80px;
        background: white;
        z-index: 5;
    }
    
    .quick-templates {
        padding: 6px 0 8px 0;
        gap: 6px;
    }
    
    .template-capsule {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .chat-input-container {
        padding: 16px;
        gap: 10px;
        border-radius: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e9ecef;
        z-index: 10;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .chat-input {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
        max-height: 120px;
        resize: none;
    }
    
    .chat-send {
        width: 48px;
        height: 48px;
        font-size: 18px;
        margin-right: 0;
    }
    
    .chat-fab {
        width: 56px;
        height: 56px;
        font-size: 22px;
        bottom: 20px;
        right: 20px;
        z-index: 10000;
    }
}

@media (max-width: 480px) {
    .chat-header h4 {
        font-size: 16px;
    }
    
    .chat-status {
        font-size: 11px;
    }
    
    .chat-input {
        font-size: 13px;
        min-height: 44px;
    }
    
    .chat-send {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .quick-templates {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .template-capsule {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Crisis Support Message */
.crisis-support-message {
    padding: 0;
}

.crisis-support-message p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #333;
}

.crisis-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.crisis-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    min-width: 100px;
    text-align: center;
}

.crisis-button i {
    font-size: 18px;
    margin-bottom: 4px;
}

.crisis-button span {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

.crisis-lifeline {
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #bbdefb;
}

.crisis-lifeline:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.emergency {
    background: #ffebee;
    color: #d32f2f;
    border: 2px solid #ffcdd2;
}

.emergency:hover {
    background: #d32f2f;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

/* Mobile responsiveness for crisis buttons */
@media (max-width: 768px) {
    .crisis-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .crisis-button {
        width: 100%;
        padding: 14px 16px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .crisis-button i {
        margin-bottom: 0;
        font-size: 20px;
    }
    
    .crisis-button span {
        font-size: 12px;
    }
}

/* Scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}
