/* =====================================================
   DignityLife Frontend Custom Styles
   ===================================================== */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #066fd1;
    --primary-dark: #0557a8;
    --primary-light: #3d8fde;
    --secondary-color: #6c757d;
    --accent-green: #2fb344;
    --accent-purple: #ae3ec9;
    --accent-orange: #f76707;
    --accent-cyan: #17a2b8;
    --accent-pink: #d63384;
    --gradient-primary: linear-gradient(135deg, #066fd1 0%, #0557a8 100%);
    --gradient-hero: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    --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.12);
    --shadow-hover: 0 12px 32px rgba(6, 111, 209, 0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* =====================================================
   Section Spacing & Typography
   ===================================================== */
section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

section.py-5 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

/* Hero section needs more breathing room */
.hero-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Section Headings */
.display-4 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.display-5 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #5a6570;
}

/* Card titles */
.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Step titles in How It Works */
.how-it-works-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Benefits section titles */
.benefits-section h5 {
    font-size: 1.15rem;
    font-weight: 600;
}

/* CTA section heading */
.cta-section .display-5 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
}

/* CTA section text colors */
.cta-section,
.cta-section h2,
.cta-section p,
.cta-section .lead {
    color: #ffffff !important;
}

.cta-section .lead {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Reduce inner padding on sections */
section .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Section margin bottom for title rows */
section .mb-5 {
    margin-bottom: 3.5rem !important;
}

/* =====================================================
   Navigation Styles
   ===================================================== */
.navbar {
    transition: box-shadow var(--transition-normal), background-color var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .nav-link {
    position: relative;
    transition: color var(--transition-fast);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal), left var(--transition-normal);
}

.navbar .nav-link:hover::after {
    width: 100%;
    left: 0;
}

.navbar .btn-primary {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =====================================================
   Hero Section
   ===================================================== */
.hero-section {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(6, 111, 209, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(6, 111, 209, 0.03) 0%, transparent 40%);
    pointer-events: none;
}

.hero-section h1 {
    background: linear-gradient(135deg, #1a1a2e 0%, #066fd1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .lead {
    color: #495057;
}

.hero-image-container {
    position: relative;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.hero-image-container::before {
    display: none;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 0 !important;
    display: block;
    object-fit: contain;
    max-height: 520px;
    box-shadow: none !important;
    border: none !important;
}

.hero-image-container:hover {
    transform: none;
    box-shadow: none !important;
}

/* Fallback placeholder styles (if image fails to load) */
.hero-image-placeholder {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(6, 111, 209, 0.1);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-image-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
   Button Styles
   ===================================================== */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline-secondary {
    transition: all var(--transition-fast);
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: 8px;
}

/* =====================================================
   Feature Cards
   ===================================================== */
.features-section .card {
    border-radius: 12px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
}

.features-section .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.features-section .card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.features-section .card:hover::before {
    transform: scaleX(1);
}

/* Varied icon colors for features */
.features-section .card:nth-child(1) .feature-icon {
    background: linear-gradient(135deg, #066fd1 0%, #0557a8 100%);
}

.features-section .card:nth-child(2) .feature-icon {
    background: linear-gradient(135deg, #2fb344 0%, #1f7a2e 100%);
}

.features-section .card:nth-child(3) .feature-icon {
    background: linear-gradient(135deg, #ae3ec9 0%, #8a2fb3 100%);
}

.features-section .card:nth-child(4) .feature-icon {
    background: linear-gradient(135deg, #f76707 0%, #d95a06 100%);
}

.features-section .card:nth-child(5) .feature-icon {
    background: linear-gradient(135deg, #d63384 0%, #b02a6f 100%);
}

.features-section .card:nth-child(6) .feature-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #128293 100%);
}

.feature-icon {
    transition: transform var(--transition-normal);
}

.card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* =====================================================
   How It Works Section
   ===================================================== */
.how-it-works-section {
    position: relative;
}

.how-it-works-section .row > div {
    position: relative;
}

/* Connecting lines between steps */
.how-it-works-section .row > div:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 32px;
    right: -10%;
    width: 20%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    display: none;
}

@media (min-width: 992px) {
    .how-it-works-section .row > div:not(:last-child)::after {
        display: block;
    }
}

.step-number {
    position: relative;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.step-number::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px dashed rgba(6, 111, 209, 0.3);
    animation: rotate 20s linear infinite;
}

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

.how-it-works-section .text-center:hover .step-number {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* =====================================================
   Benefits Section
   ===================================================== */
.benefits-section .d-flex {
    padding: 1.5rem;
    border-radius: 12px;
    transition: background-color var(--transition-normal), transform var(--transition-normal);
}

.benefits-section .d-flex:hover {
    background-color: #f8f9fa;
    transform: translateX(8px);
}

/* Varied colors for benefit icons */
.benefits-section .col-lg-6:nth-child(1) .bg-primary {
    background: linear-gradient(135deg, #2fb344 0%, #1f7a2e 100%) !important;
}

.benefits-section .col-lg-6:nth-child(2) .bg-primary {
    background: linear-gradient(135deg, #066fd1 0%, #0557a8 100%) !important;
}

.benefits-section .col-lg-6:nth-child(3) .bg-primary {
    background: linear-gradient(135deg, #ae3ec9 0%, #8a2fb3 100%) !important;
}

.benefits-section .col-lg-6:nth-child(4) .bg-primary {
    background: linear-gradient(135deg, #f76707 0%, #d95a06 100%) !important;
}

.benefits-section .col-lg-6:nth-child(5) .bg-primary {
    background: linear-gradient(135deg, #17a2b8 0%, #128293 100%) !important;
}

.benefits-section .col-lg-6:nth-child(6) .bg-primary {
    background: linear-gradient(135deg, #d63384 0%, #b02a6f 100%) !important;
}

.benefits-section .flex-shrink-0 > div {
    transition: transform var(--transition-normal);
}

.benefits-section .d-flex:hover .flex-shrink-0 > div {
    transform: scale(1.15);
}

/* =====================================================
   CTA Section
   ===================================================== */
.cta-section {
    background: linear-gradient(135deg, #066fd1 0%, #0a4a8a 50%, #083d73 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: pulse-bg 15s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(25%, 25%); }
}

.cta-section .btn-light {
    background: #ffffff;
    color: var(--primary-color);
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cta-section .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.cta-section .btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.cta-section .btn-outline-light:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

/* =====================================================
   Footer Styles
   ===================================================== */
.footer.bg-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

.footer a {
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer a:hover {
    color: #ffffff !important;
    padding-left: 5px;
}

.footer h5, .footer h6 {
    position: relative;
    display: inline-block;
}

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

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

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 1rem 1.5rem;
}

.form-control {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    border: 1px solid #dee2e6;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 111, 209, 0.15);
}

/* =====================================================
   Section Titles
   ===================================================== */
.display-5 {
    position: relative;
}

section > .container-xl > .row:first-child .display-5::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* =====================================================
   Scroll Animations (Fade In)
   ===================================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   Custom Scrollbar
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* =====================================================
   Responsive Adjustments
   ===================================================== */
@media (max-width: 991px) {
    section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    section.py-5 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    .display-4 {
        font-size: 2.25rem;
    }

    .display-5 {
        font-size: 1.85rem;
    }
}

@media (max-width: 768px) {
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    section.py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .hero-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .hero-section h1,
    .display-4 {
        font-size: 1.85rem;
    }

    .display-5 {
        font-size: 1.5rem;
    }

    .lead {
        font-size: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    section .mb-5 {
        margin-bottom: 2.5rem !important;
    }

    .benefits-section .d-flex:hover {
        transform: none;
    }

    .features-section .card:hover {
        transform: translateY(-4px);
    }

    .cta-section .display-5 {
        font-size: 1.5rem;
    }
}
