/* ==========================================================================
   LifeShare - Modern Healthcare UI Stylesheet
   Primary Color: #E53935 (Red)
   Font Family: Poppins, sans-serif
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #E53935;
    --primary-hover: #D32F2F;
    --primary-light: #FFEBEE;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --bg-light: #F8F9FA;
    --border-radius: 16px;
    --card-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 18px 40px rgba(229, 57, 53, 0.18);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #F8F9FA;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   Universal Page Background Image Overlay Engine
   ========================================================================== */

/* Glassmorphism Glossy Card Styling */
.glass-card {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

/* 1. Donor Dashboard & Auth Pages Backdrop */
.auth-bg-wrapper {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(185, 28, 28, 0.78) 100%),
                url('https://images.unsplash.com/photo-1579154204601-01588f351e67?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 60px 0;
}

/* 2. Become a Donor (index.php) Background */
.become-donor-bg {
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 235, 238, 0.82) 100%),
                url('https://images.unsplash.com/photo-1615461066841-6116e61058f4?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 50px 0;
}

/* 3. Find Donor (search.php) Background */
.find-donor-bg {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 235, 238, 0.84) 100%),
                url('https://images.unsplash.com/photo-1584515979956-d9f6e5d09982?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 50px 0;
}

/* 4. Blood Requests (donor_requests.php & result.php) Background */
.requests-bg {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(185, 28, 28, 0.78) 100%),
                url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 40px 0;
}

/* 5. View Donors Directory (view_donors.php) Background */
.directory-bg {
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 235, 238, 0.85) 100%),
                url('https://images.unsplash.com/photo-1532938911079-1b06ac7ceec7?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 40px 0;
}

/* 6. Track Request Status (request_status.php) Background */
.track-status-bg {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.90) 0%, rgba(255, 235, 238, 0.88) 100%),
                url('https://images.unsplash.com/photo-1584515979956-d9f6e5d09982?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
    padding: 50px 0;
}

/* Typography Utilities */
.tracking-wide {
    letter-spacing: 0.5px;
}
.fs-7 {
    font-size: 0.75rem;
}
.text-danger-gradient {
    background: linear-gradient(135deg, #E53935 0%, #FF5252 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Brand Icon Box */
.brand-icon {
    width: 42px;
    height: 42px;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Navigation Bar */
.main-navbar {
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.main-navbar .nav-link {
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}
.main-navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Button Hover Effects */
.btn-hover-effect {
    transition: var(--transition);
}
.btn-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.3) !important;
}

/* 🏠 Home Page Hero Section */
.hero-section {
    min-height: 88vh;
    background: url('https://images.unsplash.com/photo-1579154204601-01588f351e67?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat fixed !important;
    position: relative;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(185, 28, 28, 0.82) 100%);
    z-index: 1;
}

.btn-hero-cta {
    background-color: var(--primary-color);
    border: none;
    transition: var(--transition);
}
.btn-hero-cta:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(229, 57, 53, 0.4) !important;
}
.btn-hero-outline {
    border: 2px solid #FFFFFF;
    transition: var(--transition);
}
.btn-hero-outline:hover {
    background-color: #FFFFFF;
    color: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* Card Styling */
.custom-card, .card {
    border-radius: var(--border-radius) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow) !important;
}

/* Stat Cards */
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Blood Circle Badges */
.blood-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.2);
    transition: var(--transition);
}
.blood-badge-card:hover .blood-circle {
    transform: scale(1.1);
}

/* Feature Icons */
.feature-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating Action Button */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 14px 24px;
    border-radius: 50px;
    text-decoration: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(229, 57, 53, 0.4);
}
.floating-btn:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF;
    transform: translateY(-4px) scale(1.05);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    background-color: var(--text-dark);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* Footer Hover Effects */
.footer-links a:hover, .social-links a:hover {
    color: var(--primary-color) !important;
    transition: var(--transition);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #E2E8F0;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(229, 57, 53, 0.15);
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Universal Reset & Overflow Protection */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

img, svg, video, iframe {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6, .hero-title, .display-1, .display-2, .display-3, .display-4 {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Table Responsive Touch Support */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

/* 1. Mobile Viewports (< 576px) */
@media (max-width: 575.98px) {
    .container, .container-fluid {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    /* Navbar Mobile Styling */
    .navbar-brand .fs-4 {
        font-size: 1.15rem !important;
    }
    .navbar-brand .fs-7 {
        font-size: 0.62rem !important;
    }
    .brand-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.95rem !important;
    }

    /* Hero Section Mobile */
    .hero-section {
        min-height: auto !important;
        padding: 35px 0 !important;
    }
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    .hero-subtitle {
        font-size: 0.9rem !important;
    }

    /* Background Wrappers Padding */
    .auth-bg-wrapper, .become-donor-bg, .find-donor-bg, .requests-bg, .directory-bg {
        padding: 20px 0 !important;
        min-height: auto !important;
    }

    /* Button Full Width Stacking on Mobile */
    .btn-hero-cta, .btn-hero-outline, .hero-section .btn {
        width: 100% !important;
        margin-bottom: 8px;
    }

    /* Button Groups Wrapping */
    .btn-group {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    .btn-group .btn {
        border-radius: 50px !important;
        margin-bottom: 6px;
        width: 100% !important;
    }

    /* Cards & Modals */
    .card-body {
        padding: 1.15rem !important;
    }
    .card-header {
        padding: 1rem !important;
    }
    .glass-card {
        border-radius: 14px !important;
    }

    /* Floating Action Buttons */
    .floating-btn {
        bottom: 15px !important;
        right: 15px !important;
        padding: 10px 16px !important;
        font-size: 0.82rem !important;
    }
    .back-to-top-btn {
        bottom: 15px !important;
        left: 15px !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* Stat Cards */
    .stat-card {
        padding: 1rem 0.5rem !important;
    }
    .stat-card h2 {
        font-size: 1.4rem !important;
    }
    .stat-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }
}

/* 2. Tablet Viewports (576px to 991.98px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .hero-section {
        min-height: auto !important;
        padding: 50px 0 !important;
    }
    .hero-title {
        font-size: 2.2rem !important;
    }
    .auth-bg-wrapper, .become-donor-bg, .find-donor-bg, .requests-bg, .directory-bg {
        padding: 35px 0 !important;
    }
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        margin-top: 0.5rem;
    }
}

/* 3. Desktop Viewports (>= 992px) */
@media (min-width: 992px) {
    .hero-section {
        min-height: 88vh;
    }
}