/* 
 * Kundu Pathology & Diagnostic Centre Management System - Main Custom CSS Stylesheet
 * Integrates modern design, glassmorphism, smooth micro-animations, and light/dark theme variables.
 */

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

:root {
    --primary-color: #0A5EB0;
    --primary-rgb: 10, 94, 176;
    --accent-color: #F97316;
    --accent-rgb: 249, 115, 22;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-color: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 20px -5px rgba(10, 94, 176, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 25px -5px rgba(10, 94, 176, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --border-radius: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



/* Force override Bootstrap primary colors to match the theme */
.text-primary {
    color: var(--primary-color) !important;
}
.text-accent {
    color: var(--accent-color) !important;
}
.bg-primary {
    background-color: var(--primary-color) !important;
}
.bg-accent {
    background-color: var(--accent-color) !important;
}
.border-primary {
    border-color: var(--primary-color) !important;
}


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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Glassmorphism Header */
.navbar-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    z-index: 1000;
}

.navbar-glass .nav-link {
    color: var(--text-color) !important;
    opacity: 0.85;
    padding: 0.5rem 1.25rem !important;
    border-radius: 20px;
    transition: var(--transition-smooth);
    margin: 0 0.15rem;
}

.navbar-glass .nav-link:hover {
    color: var(--primary-color) !important;
    opacity: 1;
    background-color: rgba(var(--primary-rgb), 0.08);
}

.navbar-glass .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    opacity: 1;
    background-color: rgba(var(--primary-rgb), 0.12);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: var(--transition-smooth);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: var(--transition-smooth);
}
.btn-accent:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(var(--accent-rgb), 0.3);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-color);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.theme-toggle-btn:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
    transform: rotate(45deg);
}

/* Hover Cards */
.hover-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}
.hover-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(var(--primary-rgb), 0.1) inset;
    border-color: rgba(var(--primary-rgb), 0.4);
}

/* Floating Emergency Action Widgets */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.floating-btn:hover {
    transform: scale(1.1) rotate(5deg);
    color: white;
}

.floating-whatsapp {
    background-color: #25D366;
}

.floating-phone {
    background-color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--accent-rgb), 0.04) 100%);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
}

.hero-shape-1 {
    width: 300px;
    height: 300px;
    background-color: rgba(var(--primary-rgb), 0.2);
    top: -50px;
    right: -50px;
}

.hero-shape-2 {
    width: 250px;
    height: 250px;
    background-color: rgba(var(--accent-rgb), 0.1);
    bottom: -50px;
    left: -50px;
}

/* Appointment Wizard */
.wizard-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
.wizard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.wizard-container .nav-pills {
    background-color: rgba(var(--primary-rgb), 0.04) !important;
    border: 1px solid var(--border-color);
    padding: 4px !important;
}

.wizard-container .nav-pills .nav-link {
    color: var(--text-color) !important;
    transition: var(--transition-smooth);
    opacity: 0.8;
}

.wizard-container .nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.wizard-container .nav-pills .nav-link:not(.active):hover {
    background-color: rgba(var(--primary-rgb), 0.08) !important;
    opacity: 1;
}

/* Admin Dashboard Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--bg-color);
    overflow-y: auto;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav-link:hover, .sidebar-nav-link.active {
    background-color: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-color);
}

.sidebar-nav-link.active {
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
}

/* Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-primary-soft {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

.bg-accent-soft {
    background-color: rgba(var(--accent-rgb), 0.1);
    color: var(--accent-color);
}

/* File Upload Progress Bar */
.upload-progress-wrapper {
    margin-top: 1rem;
    display: none;
}

.progress-bar-custom {
    height: 6px;
    border-radius: 3px;
    background-color: var(--border-color);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.1s linear;
}

/* Image preview box */
.image-preview-box {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background-color: rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s;
}

.image-preview-box:hover {
    border-color: var(--primary-color);
}

.image-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Footer link & text legibility improvements */
footer .text-muted, footer a.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: var(--transition-smooth);
}
footer a.text-muted:hover {
    color: var(--accent-color) !important;
}
footer .list-unstyled a {
    color: rgba(255, 255, 255, 0.6) !important;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-block;
}
footer .list-unstyled a:hover {
    color: var(--accent-color) !important;
    transform: translateX(4px);
}

/* Responsive side nav for mobile */
@media (max-width: 991.98px) {
    .admin-wrapper {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh;
        position: relative;
    }
    
    .admin-mobile-header {
        position: sticky;
        top: 0;
        z-index: 1040;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        background: var(--card-bg) !important;
        flex-shrink: 0;
    }
    
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1060 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: var(--shadow-lg) !important;
        border-right: 1px solid var(--border-color);
        background: var(--card-bg) !important;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column;
        padding: 1.5rem 1rem !important;
    }
    
    body.admin-sidebar-open .admin-sidebar {
        left: 0 !important;
    }
    
    /* Backdrop Overlay */
    .admin-sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    body.admin-sidebar-open .admin-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }
    
    .admin-content {
        padding: 1.5rem 1rem !important;
        width: 100% !important;
        flex-grow: 1;
    }
    
    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    /* Header & Navbar Mobile Responsiveness Updates */
    .navbar-glass .navbar-brand {
        flex: 1 !important;
        min-width: 0 !important;
        white-space: normal !important;
        margin-right: 0.5rem !important;
        display: flex !important;
        align-items: center !important;
    }
    .navbar-glass .navbar-brand span {
        font-size: 1.05rem !important;
        line-height: 1.25 !important;
        display: inline-block;
    }
    .navbar-glass .order-lg-last {
        flex-shrink: 0 !important;
    }
    .navbar-glass .navbar-toggler {
        border: none !important;
        padding: 0.5rem !important;
        background: rgba(var(--primary-rgb), 0.05) !important;
        border-radius: 10px !important;
        color: var(--primary-color) !important;
        transition: var(--transition-smooth) !important;
    }
    .navbar-glass .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15) !important;
        outline: none !important;
    }
    /* Restyle the mobile collapse menu for a premium glassmorphic look */
    .navbar-glass .navbar-collapse {
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-radius: var(--border-radius);
        padding: 1.25rem;
        margin-top: 0.75rem;
        border: 1px solid var(--glass-border);
        box-shadow: var(--shadow-lg);
    }
    .navbar-glass .nav-link {
        margin: 0.25rem 0 !important;
        padding: 0.75rem 1.25rem !important;
        border-radius: 12px !important;
    }
}

/* ---------------------------------------------------------------------
 * Mobile Layout, Typography & Carousel Styling (Antigravity Updates)
 * --------------------------------------------------------------------- */

/* Mobile text line clamping */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    /* Responsive mobile typography adjustments */
    h1, .display-5 {
        font-size: 1.85rem !important;
        line-height: 1.25 !important;
    }
    h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    h3 {
        font-size: 1.3rem !important;
    }
    h4 {
        font-size: 1.15rem !important;
    }
    h5 {
        font-size: 1.05rem !important;
    }
    p, .lead {
        font-size: 0.9rem !important;
    }
    
    /* Header/Brand mobile scaling */
    .navbar-glass .navbar-brand span {
        font-size: 0.95rem !important;
    }
    .navbar-glass .navbar-brand img {
        height: 32px !important;
    }
    .navbar-glass .navbar-brand .rounded-circle {
        width: 32px !important;
        height: 32px !important;
    }
    .navbar-glass .navbar-brand .rounded-circle i {
        font-size: 1rem !important;
    }
    
    .hero-section {
        padding: 3rem 0 !important;
    }
    
    /* Mobile Touch-Friendly Swipe Carousel Container */
    .mobile-carousel-container {
        position: relative;
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .mobile-carousel {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.5rem 0 1.5rem 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        scrollbar-width: none !important; /* Firefox */
    }
    
    .mobile-carousel::-webkit-scrollbar {
        display: none !important; /* Chrome, Safari, Opera */
    }
    
    .mobile-carousel > [class*="col-"] {
        flex: 0 0 85% !important;
        max-width: 85% !important;
        scroll-snap-align: center !important;
        margin-right: 16px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Carousel Navigation HUD for Mobile */
    .mobile-carousel-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    .mobile-carousel-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-sm);
        cursor: pointer;
        transition: var(--transition-smooth);
        padding: 0;
    }
    
    .mobile-carousel-btn:active {
        transform: scale(0.9);
        background-color: var(--primary-color);
        color: #fff;
    }
    
    .mobile-carousel-dots {
        display: flex;
        gap: 8px;
    }
    
    .mobile-carousel-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: var(--border-color);
        transition: var(--transition-smooth);
        cursor: pointer;
    }
    
    .mobile-carousel-dot.active {
        background-color: var(--primary-color);
        width: 22px;
        border-radius: 4px;
    }
    
    /* 2-Column Mobile Card Layout Adjustments */
    .col-6 {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    .col-6 .card-body, .col-6 .hover-card {
        padding: 1rem !important;
    }
    
    /* Scale down profile sizes for 2-column view */
    .col-6 img.rounded-circle, 
    .col-6 .rounded-circle.bg-primary-soft {
        width: 75px !important;
        height: 75px !important;
    }
    
    .col-6 .card-title, .col-6 h4 {
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
    }
    
    .col-6 .card-text, .col-6 p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .col-6 .btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.5rem !important;
        border-radius: 6px !important;
    }
    
    .col-6 .bg-light.p-3 {
        padding: 0.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .col-6 .bg-light.p-3 strong,
    .col-6 .bg-light.p-3 span {
        font-size: 0.72rem !important;
    }
    
    /* Hide non-essential layout blocks in 2-column mobile card to prevent height bloat */
    .mobile-hide {
        display: none !important;
    }
}
