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

:root {
    /* Unified medical purple-blue palette */
    --primary-color: #667eea; /* Medical purple-blue */
    --primary-light: #764ba2; /* Deeper purple */
    --primary-dark: #5a67d8; /* Darker blue */
    --primary-rgb: 102, 126, 234; /* RGB values for primary color */
    --primary-lighter: #e6e9ff; /* Very light purple-blue */
    
    /* Secondary colors - complementary blues */
    --secondary-color: #4c63d2; /* Professional blue */
    --secondary-light: #667eea; /* Light purple-blue */
    --secondary-dark: #4338ca; /* Deep blue */
    
    /* Accent colors - medical palette */
    --accent-color-1: #10b981; /* Medical green */
    --accent-color-2: #f59e0b; /* Warning amber */
    --accent-color-3: #8b5cf6; /* Royal purple */
    --accent-color-4: #ef4444; /* Critical red */
    
    /* Background and text colors */
    --light-bg: #ffffff; /* Pure white background */
    --card-bg: #ffffff; /* Card background */
    --dark-text: #2c3e50; /* Dark text */
    --medium-text: #6c757d; /* Medium gray text */
    --light-text: #ffffff; /* White text */
    
    /* Gradient backgrounds */
    --gradient-bg-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Primary medical gradient */
    --gradient-bg-2: linear-gradient(135deg, #667eea 0%, #4c63d2 100%); /* Secondary medical gradient */
    --gradient-bg-3: linear-gradient(135deg, #8b5cf6 0%, #667eea 100%); /* Accent medical gradient */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Border radii */
    --border-radius-sm: 0.5rem;
    --border-radius-md: 1rem;
    --border-radius-lg: 1.5rem;
    --border-radius-full: 9999px;
    
    /* Font families */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Quicksand', sans-serif;
}

body, button, input, select, textarea {
    font-family: var(--font-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 600;
}

body {
    background-color: #f9fafb;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(147, 51, 234, 0.07) 0%, transparent 40%), 
        radial-gradient(circle at 90% 20%, rgba(192, 132, 252, 0.05) 0%, transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(99, 102, 241, 0.07) 0%, transparent 40%);
    background-attachment: fixed;
    background-size: 200% 200%;
    animation: gradientAnimation 15s ease infinite;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Card styling with glass morphism */
.card {
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    z-index: 1;
}

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

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

/* Button styling */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: white;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
    transform: skewX(-25deg);
    transition: all 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

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

.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-color-2), var(--primary-light));
    border: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-color-3), rgba(251, 191, 36, 0.8));
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-color-4), rgba(236, 72, 153, 0.8));
    border: none;
}

/* Gradient text */
.text-gradient {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color-1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Form controls with modern styling */
.form-control {
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #9333ea, #7e22ce, #6d28d9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.navbar-brand {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.6rem 1.1rem !important;
    margin: 0 0.3rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: #FFFFFF !important;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF !important;
    font-weight: 600;
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 3px;
    border-radius: 3px;
    background: #FFFFFF;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-link:hover:before, 
.nav-link.active:before {
    opacity: 1;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.5rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-icon {
    margin-right: 0.7rem;
    font-size: 1.1rem;
    color: white;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Dropdown styling */
.dropdown-menu {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.9), rgba(109, 40, 217, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    padding: 0.7rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    transform: translateX(5px);
}

.dropdown-header {
    font-weight: 600;
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

/* Fix for navbar overlap with content */
body {
    padding-top: 80px;
}

.main-content {
    padding-top: 1rem;
}

/* Table styling */
.table {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: #ffffff;
}

/* Ensure crisp text rendering in tables */
.table td, .table th {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 500;
    color: #2c3e50;
    background: #ffffff;
    border-color: #e9ecef;
}

.table tbody tr:hover td {
    background-color: #f8f9fa;
}

.table thead th {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(109, 40, 217, 0.1));
    border-bottom: none;
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--dark-text);
}

/* Badge styling */
.badge {
    border-radius: var(--border-radius-full);
    padding: 0.5em 0.8em;
    font-weight: 600;
    font-size: 0.875rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: #ffffff !important;
    color: #2c3e50 !important;
    border: 1px solid #dee2e6;
}

/* Role badge styles */
.badge-primary {
    background-color: #007bff !important;
    color: #ffffff !important;
}

.badge-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.badge-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* Override any remaining blur effects */
.table .badge {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    transform: none !important;
    -webkit-transform: none !important;
}

/* Stats cards */
.stats-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color-1));
    opacity: 0.8;
}

.stats-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.2) 38%, rgba(255,255,255,0.2) 40%, rgba(255,255,255,0) 48%);
    transform: translateX(-100%) skewX(-15deg);
    transition: all 0.7s ease;
}

.stats-card:hover::after {
    transform: translateX(100%) skewX(-15deg);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    position: relative;
    z-index: 2;
}

.stats-icon i {
    font-size: 24px;
    color: white;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.stats-info {
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

.stats-info h5 {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.8;
}

.stats-info h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.stats-info p {
    margin: 0;
    font-size: 0.75rem;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.2;
        transform: scale(0.95);
    }
    100% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

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

/* Custom list group styling */
.list-group-item {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Progress bar styling */
.progress {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    height: 0.75rem;
}

.progress-bar {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color-1));
    border-radius: var(--border-radius-full);
}

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

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Alert styling */
.alert {
    border-radius: var(--border-radius-md);
    border: none;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: var(--shadow-md);
}

.alert-primary {
    background-color: rgba(139, 92, 246, 0.2);
    color: var(--primary-dark);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--secondary-dark);
}

.alert-warning {
    background-color: rgba(251, 191, 36, 0.2);
    color: #92400E;
}

.alert-danger {
    background-color: rgba(236, 72, 153, 0.2);
    color: #9D174D;
}

/* Pagination styling */
.pagination {
    margin: 20px 0;
    padding: 10px 0;
}

.page-link {
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    margin: 0 0.2rem;
    border-color: rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.page-link:hover {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--primary-dark);
    transform: translateY(-2px);
    border-color: var(--primary-color);
    text-decoration: none;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* User Management Action Buttons */
.btn-group .btn {
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
    background-color: transparent;
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
    text-decoration: none;
}

.btn-outline-info:focus,
.btn-outline-info:active {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

/* Login page styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    max-width: 400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color-1), var(--secondary-color), var(--accent-color-3));
    z-index: 2;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--dark-text);
    position: relative;
    z-index: 2;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form .form-control {
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.login-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.login-form .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
}

/* Modal styling */
.modal-content {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-title {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color-1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    font-weight: 700;
}

/* Tooltip styling */
.tooltip .tooltip-inner {
    background-color: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    box-shadow: var(--shadow-md);
}

/* Mobile Responsive Functional Fixes - Preserving Original Design */
@media (max-width: 768px) {
    /* Sidebar responsive functionality only */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Form responsive functionality only */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 576px) {
    /* Functional fixes only for extra small screens */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}