/* Custom styles for the lab application */

/* Modern Laboratory Dashboard Styles */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content h1 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.hero-meta small {
    display: block;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.lab-icon-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.lab-icon-large i {
    font-size: 3rem;
    color: rgba(255,255,255,0.9);
    animation: float 3s ease-in-out infinite;
}

.lab-icon-large i:nth-child(1) { animation-delay: 0s; }
.lab-icon-large i:nth-child(2) { animation-delay: 1s; }
.lab-icon-large i:nth-child(3) { animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.badge-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.quick-actions {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.quick-action-item {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.25rem;
}

.quick-action-item:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.quick-action-item:hover .quick-action-icon {
    transform: scale(1.1);
}

/* Hover effects for cards */
.hover-lift {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Enhanced breadcrumb styling */
.breadcrumb {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

/* Alert improvements */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Card enhancements */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border: none;
    font-weight: 600;
}

/* Button enhancements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Table enhancements */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Chart container */
.chart-area {
    position: relative;
    margin: auto;
    height: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .hover-lift:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* Enhanced styles for professional hospital laboratory system with advanced animations */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-secondary); /* Dark gradient background */
    color: var(--text-dark);
    animation: fadeIn 0.8s ease-in;
    overflow-x: hidden;
    position: relative;
}

/* Elegant scrolling marquee for welcome message */
.elegant-marquee {
    width: 100%;
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    margin-bottom: 20px;
    padding: 10px 0;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bbd;
    animation: marquee 20s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 86, 179, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 188, 212, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(40, 167, 69, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: floatParticles 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes floatParticles {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(90deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    75% { transform: translateY(-10px) rotate(270deg); }
}

/* Professional Bright Theme Color Variables */
:root {
    --primary-medical: #2563eb; /* Bright professional blue */
    --secondary-medical: #64748b;
    --success-medical: #10b981;
    --danger-medical: #ef4444;
    --warning-medical: #f59e0b;
    --info-medical: #06b6d4;
    --light-medical: #f8fafc;
    --dark-medical: #1e293b;
    --bg-light: #ffffff; /* Bright white background */
    --bg-card: #ffffff; /* White card background */
    --text-dark: #1e293b; /* Dark text */
    --text-light: #ffffff; /* Light text for dark elements */

    --accent-medical: #3b82f6; /* Bright blue accent */
    --border-light: #e2e8f0; /* Light border */
    --shadow-light: rgba(37, 99, 235, 0.1); /* Light blue shadow */
    --gradient-primary: linear-gradient(135deg, #2563eb, #3b82f6);
    --gradient-secondary: linear-gradient(135deg, #f8fafc, #e2e8f0);
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* New animations for lab realism */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes staggerIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Sidebar styles for left menu */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    border-radius: 0 10px 10px 0;
}

.sidebar-brand {
    display: block;
    padding: 1rem;
    font-weight: 800;
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
}

.sidebar-brand:hover {
    color: var(--light-medical);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0.25rem 0.5rem;
}

.sidebar-link:hover {
    color: var(--light-medical);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-text {
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

#greeting {
    font-size: 1.1rem;
    opacity: 0.9;
    color: var(--text-light);
}

#digital-clock {
    font-size: 1rem;
    opacity: 0.8;
    color: var(--text-light);
}

/* Main content adjustment */
.main-content {
    margin-left: 250px;
    padding-top: 20px;
}

/* Sidebar toggle for mobile */
.sidebar-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: var(--primary-medical);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--accent-medical);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease;
}

/* Sidebar close button */
.sidebar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1002;
    display: none;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    color: var(--light-medical);
}

/* Responsive sidebar adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar.active .sidebar-overlay {
        display: block;
    }
    .sidebar.active .sidebar-close {
        display: block;
    }
}

.card {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Deeper shadow for realism */
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideUp 0.6s ease-out;
    background: var(--bg-card); /* Clean white for medical cards */
    transform: translateY(20px);
    transition: box-shadow 0.3s ease;
    color: var(--text-dark);
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lab-specific card for results */
.result-card {
    border-left: 4px solid var(--success-medical);
    animation: slideInLeft 0.7s ease-out;
}

.table {
    animation: fadeIn 0.5s ease-in;
    border-radius: 8px;
    overflow: hidden;
    color: var(--text-dark);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(30, 58, 138, 0.1); /* Subtle medical blue */
}

.table-hover tbody tr {
    transition: all 0.3s ease;
    animation: staggerIn 0.5s ease-out forwards;
}

.table-hover tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.1); /* Success green on hover */
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stagger animation for table rows */
.table-hover tbody tr:nth-child(odd) { animation-delay: 0.1s; }
.table-hover tbody tr:nth-child(even) { animation-delay: 0.2s; }

.btn {
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    transform: translateY(0);
    position: relative;
    overflow: hidden;
    color: var(--text-dark);
}

.btn::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 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    animation: pulse 0.6s ease;
}

/* Smaller action buttons for tables */
.small-action-btn {
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--primary-medical);
    border-color: var(--primary-medical);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background-color: var(--success-medical);
    border-color: var(--success-medical);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Print button specific */
.btn-print {
    animation: pulse 2s infinite;
}

/* Enhanced Form Controls for Professional Medical Interface */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 16px;
    color: var(--text-dark);
    background: var(--bg-card);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.form-control::placeholder {
    color: var(--secondary-medical);
    opacity: 0.7;
}

.form-control:focus {
    border-color: var(--primary-medical);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1), 0 4px 12px rgba(30, 58, 138, 0.15);
    transform: translateY(-1px);
    background-color: var(--bg-card);
    outline: none;
}

.form-control:hover {
    border-color: var(--accent-medical);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

.form-control:disabled {
    background-color: rgba(51, 65, 85, 0.5);
    color: var(--secondary-medical);
    cursor: not-allowed;
}

/* Select Elements */
.form-select {
    border-radius: 8px;
    border: 2px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 16px;
    color: var(--text-dark);
    background: var(--bg-card) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.75rem center;
    background-size: 1.5em 1.5em;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-medical);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1), 0 4px 12px rgba(30, 58, 138, 0.15);
    transform: translateY(-1px);
    background-color: var(--bg-card);
    outline: none;
}

.form-select:hover {
    border-color: var(--accent-medical);
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

/* Textarea Enhancements */
.form-control[type="textarea"],
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-dark);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.input-group .form-control:focus {
    border-left: 2px solid var(--primary-medical);
    z-index: 3;
}

/* Form Labels */
.form-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

.form-label::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--primary-medical);
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

/* Required Field Indicators */
.form-label.required::after {
    content: '*';
    color: var(--danger-medical);
    font-size: 1.2em;
    font-weight: bold;
    margin-left: 4px;
    vertical-align: baseline;
    position: relative;
    top: -2px;
}

.form-label.required {
    color: var(--text-dark);
}

/* Required field styling */
input[required], select[required], textarea[required] {
    border-left: 3px solid var(--danger-medical);
}

input[required]:focus, select[required]:focus, textarea[required]:focus {
    border-left-color: var(--danger-medical);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Professional Form Layout Enhancements */
.form-section {
    background: linear-gradient(135deg, var(--bg-card), rgba(30, 58, 138, 0.02));
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-section h5, .form-section h6 {
    color: var(--primary-medical);
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-medical);
    padding-bottom: 8px;
}

.form-group-inline {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-group-inline .form-control {
    flex: 1;
}

.form-group-inline .btn {
    white-space: nowrap;
}

/* Enhanced Field Groups for Lab Tests */
.test-fields {
    background: rgba(6, 182, 212, 0.03);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    animation: slideInLeft 0.4s ease-out;
}

.test-fields h6 {
    color: var(--info-medical);
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Improved Row Spacing for Complex Forms */
.row.g-3 .col-md-6,
.row.g-3 .col-md-4 {
    margin-bottom: 15px;
}

.row.g-3 .col-md-6:last-child,
.row.g-3 .col-md-4:last-child {
    margin-bottom: 0;
}

/* Professional Button Layout */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.form-actions .btn {
    min-width: 120px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Card Layout for Forms */
.card-body {
    padding: 25px;
}

.card-header {
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary-medical), var(--accent-medical));
    border-bottom: none;
}

.card-header h4 {
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bar Enhancement */
.progress-lab {
    height: 10px;
    background-color: rgba(30, 58, 138, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0 30px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-lab .progress-bar {
    background: linear-gradient(90deg, var(--success-medical), var(--info-medical));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-lab .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive Form Improvements */
@media (max-width: 768px) {
    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 12px 15px;
    }

    .form-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .form-group-inline {
        flex-direction: column;
        gap: 10px;
    }

    .form-group-inline .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .test-fields {
        padding: 12px;
    }

    .row.g-3 .col-md-6,
    .row.g-3 .col-md-4 {
        margin-bottom: 12px;
    }
}

/* Lab form enhancements */
.lab-form .form-control {
    border-left: 4px solid var(--info-medical);
    background: linear-gradient(135deg, var(--bg-card), rgba(6, 182, 212, 0.02));
}

.lab-form .form-control:focus {
    border-left-color: var(--primary-medical);
    background: var(--bg-card);
}

.lab-form label {
    font-weight: 600;
    color: var(--text-dark);
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

.lab-form label::before {
    content: '🔬';
    margin-right: 8px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Form Groups */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

.form-floating {
    position: relative;
}

.form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--secondary-medical);
    font-size: 0.875rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Checkbox and Radio Enhancements */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.25em;
    height: 1.25em;
    margin-top: 0.25em;
    margin-left: -1.5em;
    vertical-align: top;
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
    background-position: center;
    background-size: contain;
    border: 2px solid var(--border-light);
    appearance: none;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-medical);
    border-color: var(--primary-medical);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: var(--primary-medical);
    box-shadow: 0 0 0 0.25rem rgba(30, 58, 138, 0.25);
}

.form-check-label {
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
}

/* Range Input */
.form-range {
    width: 100%;
    height: 1.5rem;
    padding: 0;
    background-color: transparent;
    appearance: none;
}

.form-range:focus {
    outline: none;
}

.form-range::-webkit-slider-thumb {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--primary-medical);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
    transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.form-range::-webkit-slider-track {
    width: 100%;
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--border-light);
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--primary-medical);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
    transition: all 0.3s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.form-range::-moz-range-track {
    width: 100%;
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--border-light);
    cursor: pointer;
    border: none;
}

/* File Input */
.form-control[type="file"] {
    padding: 8px;
    background: var(--bg-card);
}

.form-control[type="file"]::-webkit-file-upload-button {
    background: var(--primary-medical);
    color: var(--text-light);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background: var(--accent-medical);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

/* Validation States */
.is-valid {
    border-color: var(--success-medical) !important;
}

.is-valid:focus {
    border-color: var(--success-medical) !important;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25) !important;
}

.is-invalid {
    border-color: var(--danger-medical) !important;
}

.is-invalid:focus {
    border-color: var(--danger-medical) !important;
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25) !important;
}

.valid-feedback {
    color: var(--success-medical);
    font-weight: 500;
}

.invalid-feedback {
    color: var(--danger-medical);
    font-weight: 500;
}

/* Responsive Form Adjustments */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .input-group-text {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

/* Staggered form fields */
.lab-form .mb-3:nth-child(1) { animation-delay: 0.1s; }
.lab-form .mb-3:nth-child(2) { animation-delay: 0.2s; }
.lab-form .mb-3:nth-child(3) { animation-delay: 0.3s; }

.alert {
    border-radius: 6px;
    animation: bounceIn 0.5s ease;
    border: none;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.container {
    max-width: 1000px; /* Wider for lab tables */
    animation: fadeIn 1s ease-in;
}

/* Improved table responsiveness */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge {
    transition: all 0.3s ease;
}

/* Progress bar for lab workflow */
.progress-lab {
    height: 8px;
    background-color: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-lab .progress-bar {
    transition: width 0.5s ease;
    animation: slideInLeft 0.5s ease-out;
}

/* Lab icons support (Font Awesome) */
.lab-icon {
    margin-right: 8px;
    color: var(--primary-medical);
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0); /* Metallic look for realism */
    border-radius: 50%;
    padding: 6px; /* Larger padding for more prominent */
    vertical-align: middle;
    animation: breathing 3s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5); /* 3D shadow for depth */
    border: 1px solid rgba(0, 0, 0, 0.1); /* Subtle border for realism */
    font-size: 1.1em; /* Slightly larger for better visibility */
}

.animate-pulse {
    animation: pulse 2s infinite !important;
}

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

.lab-icon:hover {
    color: var(--success-medical);
    transform: scale(1.1);
}

/* Search icon styling */
.search-icon {
    color: var(--primary-medical);
    transition: all 0.3s ease;
}

.search-icon:hover {
    color: var(--success-medical);
    transform: scale(1.1);
}

.search-icon.animate {
    animation: spin 0.5s ease-in-out;
}

/* Result highlight */
.result-highlight {
    background: linear-gradient(135deg, #d4edda, var(--light-medical));
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--success-medical);
    animation: typewriter 1s ease-out;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid var(--border-light);
}

/* Loading spinner for forms */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-medical);
    border-top: 3px solid var(--primary-medical);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.patient-card {
    background: var(--bg-card);
    padding: 30px;
    border: 2px solid var(--primary-medical);
    border-radius: 15px;
    max-width: 500px;
    margin: 20px auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.8s ease-out;
}

.patient-card h2 {
    color: var(--primary-medical);
    text-align: center;
    border-bottom: 3px solid var(--primary-medical);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.patient-info {
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.patient-info strong {
    color: var(--primary-medical);
    display: inline-block;
    width: 150px;
}

.patient-info p {
    animation: fadeIn 0.5s ease-in;
}

/* Enhanced print styles for lab reports */
@media print {
    body * {
        visibility: hidden;
        color: #000 !important;
        background: #fff !important;
    }
    .patient-card, .patient-card *, .result-card, .result-card *, .table, .table * {
        visibility: visible;
    }
    .patient-card, .result-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: 1px solid #000;
        background: #fff !important;
    }
    .no-print, .navbar, .btn:not(.btn-print), .progress-lab {
        display: none !important;
    }
    .table {
        border: 1px solid #000;
    }
    .table th, .table td {
        border: 1px solid #000;
    }
}

/* Search and Filter Form Styles */
.search-form {
    background: linear-gradient(135deg, var(--bg-light), #ffffff);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

.search-form .form-control,
.search-form .form-select {
    border-radius: 8px;
    border: 2px solid var(--border-light);
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: var(--primary-medical);
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.15);
    transform: translateY(-1px);
}

.search-form .btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}

/* Modern Table Design for Examined Patients */
.examined-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border: none;
    margin-bottom: 0;
}

.examined-table thead th {
    background: linear-gradient(135deg, var(--primary-medical), #004494);
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    padding: 15px 10px;
    border: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 150px;
    text-overflow: ellipsis;
}

.examined-table thead th::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 0.5s;
}

.examined-table thead th:hover::before {
    left: 100%;
}

.examined-table thead th i {
    margin-right: 5px;
    opacity: 0.9;
}

.examined-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-light);
}

.examined-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.05), rgba(0, 86, 179, 0.1));
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.15);
}

.examined-table tbody td {
    padding: 12px 8px;
    vertical-align: middle;
    text-align: center;
    max-width: 150px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

.examined-table tbody td:last-child {
    padding-right: 4px;
    width: 200px;
}

.examined-table tbody td:nth-child(2), /* Nama */
.examined-table tbody td:nth-child(5), /* Poliklinik */
.examined-table tbody td:nth-child(7) { /* Tes */
    text-align: left;
    max-width: 200px;
}

.examined-table .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.examined-table .small-action-btn {
    margin: 1px;
    padding: 0 4px;
    font-size: 0.65rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 40px;
    white-space: nowrap;
}

.examined-table .small-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--secondary-medical);
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--light-medical), #f8f9fa);
    border-radius: 10px;
    border: 2px dashed var(--border-light);
    animation: fadeIn 0.5s ease-in;
}

/* Responsive Table */
@media (max-width: 768px) {
    .search-form {
        padding: 15px;
        margin: 10px;
    }
    
    .search-form .row > * {
        margin-bottom: 10px;
    }
    
    .examined-table {
        font-size: 0.9rem;
        margin: 0 10px;
    }
    
    .examined-table thead th,
    .examined-table tbody td {
        padding: 8px 5px;
        max-width: 100px;
    }
    
    .examined-table tbody td:nth-child(2),
    .examined-table tbody td:nth-child(5),
    .examined-table tbody td:nth-child(7) {
        max-width: 120px;
    }
    
    .examined-table .small-action-btn {
        margin: 1px;
        padding: 0 4px;
        font-size: 0.65rem;
        min-width: 40px;
        white-space: nowrap;
    }
    
    .no-results {
        padding: 20px;
        margin: 10px;
    }
}

/* Table text length fixes for examined patients list */
.examined-table th {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.examined-table th:hover::after {
    content: attr(title);
    position: absolute;
    background: var(--dark-medical);
    color: var(--text-light);
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: normal;
    z-index: 1000;
    top: 100%;
    left: 0;
    max-width: 200px;
    word-wrap: break-word;
}

.examined-table td {
    max-width: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Specific column widths for examined patients table */
.examined-table th:nth-child(5), /* Poliklinik */
.examined-table td:nth-child(5) {
    max-width: 150px;
}

.examined-table th:nth-child(7), /* Tes */
.examined-table td:nth-child(7) {
    max-width: 150px;
}

/* Patient list table header styling */
.patient-list-table thead th {
    background: linear-gradient(135deg, var(--primary-medical), #004494);
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    padding: 15px 10px;
    border: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    max-width: 150px;
    text-overflow: ellipsis;
}

.patient-list-table thead th::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 0.5s;
}

.patient-list-table thead th:hover::before {
    left: 100%;
}

.patient-list-table thead th i {
    margin-right: 5px;
    opacity: 0.9;
}

/* Hover lift effect for cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.3);
}

/* Responsive for mobile lab views */
@media (max-width: 768px) {
    .card {
        margin: 10px;
    }
    .table {
        font-size: 0.9rem;
    }
    .result-highlight {
        font-size: 0.95rem;
    }
    .examined-table th,
    .examined-table td {
        max-width: 100px;
    }
    .examined-table th:nth-child(5),
    .examined-table td:nth-child(5),
    .examined-table th:nth-child(7),
    .examined-table td:nth-child(7) {
        max-width: 120px;
    }
}


