/* ===== CSS Custom Properties ===== */
:root {
    --hospital-primary: #0d6efd;
    --hospital-primary-dark: #0a58ca;
    --hospital-secondary: #198754;
    --hospital-secondary-dark: #146c43;
    --hospital-accent: #0dcaf0;
    --hospital-light: #f0f7ff;
    --hospital-bg: #f8f9fa;
    --hospital-text: #212529;
    --hospital-text-muted: #6c757d;
    --hospital-white: #ffffff;
    --hospital-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --hospital-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --hospital-radius: 12px;
    --hospital-radius-sm: 8px;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--hospital-bg);
    color: var(--hospital-text);
}

a, .btn-link {
    color: var(--hospital-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--hospital-primary);
    border-color: var(--hospital-primary);
    border-radius: var(--hospital-radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--hospital-primary-dark);
    border-color: var(--hospital-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--hospital-shadow);
}

.btn-success {
    background-color: var(--hospital-secondary);
    border-color: var(--hospital-secondary);
    border-radius: var(--hospital-radius-sm);
    font-weight: 500;
}

.btn-success:hover {
    background-color: var(--hospital-secondary-dark);
    border-color: var(--hospital-secondary-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(13, 110, 253, 0.35);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2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LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== Hospital Card UI ===== */
.hospital-card {
    background: var(--hospital-white);
    border-radius: var(--hospital-radius);
    box-shadow: var(--hospital-shadow);
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.25s ease;
    overflow: hidden;
}

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

.hospital-card .card-body {
    padding: 1.5rem;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--hospital-primary) 0%, #0a4da6 50%, var(--hospital-secondary) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 0 0 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
}

.hero-section .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-weight: 700;
    color: var(--hospital-text);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--hospital-text-muted);
    font-size: 1.05rem;
}

.section-header .section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--hospital-primary), var(--hospital-secondary));
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

/* ===== Service Cards ===== */
.service-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.service-card .service-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--hospital-light);
    color: var(--hospital-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.service-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-card .service-fee {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hospital-secondary);
}

.service-card .service-dept {
    font-size: 0.85rem;
    color: var(--hospital-text-muted);
}

.service-card .service-duration {
    font-size: 0.85rem;
    color: var(--hospital-text-muted);
}

/* ===== Department Cards ===== */
.dept-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dept-card .dept-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hospital-radius-sm);
    background: linear-gradient(135deg, var(--hospital-primary), var(--hospital-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.dept-card h6 {
    margin: 0;
    font-weight: 600;
}

.dept-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--hospital-text-muted);
}

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

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    color: white;
}

.floating-btn.chat-btn {
    background: linear-gradient(135deg, var(--hospital-primary), #4a90d9);
}

.floating-btn.call-btn {
    background: linear-gradient(135deg, var(--hospital-secondary), #20c997);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-item {
    min-width: 300px;
    padding: 1rem 1.25rem;
    border-radius: var(--hospital-radius-sm);
    color: white;
    font-weight: 500;
    box-shadow: var(--hospital-shadow-lg);
    animation: toast-slide-in 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-item.toast-success {
    background: linear-gradient(135deg, #198754, #20c997);
}

.toast-item.toast-error {
    background: linear-gradient(135deg, #dc3545, #e35d6a);
}

.toast-item.toast-info {
    background: linear-gradient(135deg, #0d6efd, #6ea8fe);
}

.toast-item.toast-warning {
    background: linear-gradient(135deg, #ffc107, #ffcd39);
    color: #212529;
}

.toast-item .toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.toast-item .toast-close:hover {
    opacity: 1;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Booking Cards ===== */
.booking-card {
    border-left: 4px solid var(--hospital-primary);
    padding: 1.25rem 1.5rem;
}

.booking-card.status-pending { border-left-color: #ffc107; }
.booking-card.status-confirmed { border-left-color: var(--hospital-primary); }
.booking-card.status-completed { border-left-color: var(--hospital-secondary); }
.booking-card.status-cancelled { border-left-color: #dc3545; }
.booking-card.status-checked_in { border-left-color: var(--hospital-accent); }
.booking-card.status-no_show { border-left-color: #6c757d; }

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.badge-pending { background: #fff3cd; color: #856404; }
.status-badge.badge-confirmed { background: #cfe2ff; color: #084298; }
.status-badge.badge-completed { background: #d1e7dd; color: #0f5132; }
.status-badge.badge-cancelled { background: #f8d7da; color: #842029; }
.status-badge.badge-checked_in { background: #cff4fc; color: #055160; }
.status-badge.badge-no_show { background: #e2e3e5; color: #41464b; }

/* ===== Confirmation Page (Print) ===== */
.confirmation-card {
    max-width: 650px;
    margin: 0 auto;
    padding: 2.5rem;
}

.confirmation-card .booking-ref {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hospital-primary);
    letter-spacing: 1px;
}

.confirmation-card .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.confirmation-card .detail-row:last-child {
    border-bottom: none;
}

.confirmation-card .detail-label {
    font-weight: 500;
    color: var(--hospital-text-muted);
}

.confirmation-card .detail-value {
    font-weight: 600;
}

@media print {
    .sidebar, .top-row, .floating-actions, .toast-container, .no-print {
        display: none !important;
    }
    .page { display: block !important; }
    main { padding: 0 !important; }
    .confirmation-card { box-shadow: none; border: 1px solid #ddd; }
    .print-receipt { box-shadow: none !important; border: none !important; max-width: 100% !important; }
    .receipt-actions { display: none !important; }
    .print-booking-page { padding: 0 !important; }
}

/* ===== Print Booking Receipt Page ===== */
.print-booking-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 80vh;
}

.print-receipt {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    max-width: 700px;
    width: 100%;
    padding: 2.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.receipt-header {
    text-align: center;
}

.receipt-logo {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.receipt-hospital-name {
    margin: 0;
    font-weight: 700;
    color: #1a5276;
    font-size: 1.75rem;
}

.receipt-tagline {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0.25rem 0 0;
}

.receipt-divider {
    border: none;
    border-top: 2px solid #e3e8ee;
    margin: 1.25rem 0;
}

.receipt-title-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.receipt-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem;
}

.receipt-ref {
    display: inline-block;
    background: #e8f4fd;
    border: 1px solid #b6d4e8;
    border-radius: 6px;
    padding: 0.35rem 1rem;
    font-size: 1rem;
    color: #1a5276;
    letter-spacing: 0.5px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.receipt-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #eee;
    font-size: 0.97rem;
}

.receipt-label {
    width: 40%;
    color: #6c757d;
    font-weight: 500;
}

.receipt-value {
    font-weight: 600;
    color: #2c3e50;
}

.receipt-fee {
    color: #27ae60;
    font-size: 1.05rem;
}

.receipt-status {
    text-align: center;
    margin: 1.5rem 0;
}

.receipt-status-badge {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.receipt-instructions {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.receipt-instructions h5 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #92400e;
}

.receipt-instructions ul {
    margin: 0;
    padding-left: 1.25rem;
}

.receipt-instructions li {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
    color: #78350f;
}

.receipt-footer {
    text-align: center;
    color: #6c757d;
    font-size: 0.88rem;
}

.receipt-footer p {
    margin: 0.2rem 0;
}

.receipt-contact {
    font-size: 0.85rem;
}

.receipt-generated {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-top: 0.5rem !important;
}

.receipt-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ===== Loading Spinner ===== */
.loading-section {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--hospital-light);
    border-top: 4px solid var(--hospital-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ===== Error / Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--hospital-text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ===== Page Header ===== */
.page-header {
    background: var(--hospital-white);
    border-radius: var(--hospital-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--hospital-shadow);
}

.page-header h2 {
    margin: 0;
    font-weight: 700;
    color: var(--hospital-text);
}

.page-header p {
    margin: 0.25rem 0 0;
    color: var(--hospital-text-muted);
}

/* ===== Phone Input Group ===== */
.phone-search-box {
    max-width: 480px;
    margin: 0 auto;
}

.phone-search-box .input-group {
    box-shadow: var(--hospital-shadow);
    border-radius: var(--hospital-radius);
    overflow: hidden;
}

.phone-search-box .form-control {
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.phone-search-box .form-control:focus {
    border-color: var(--hospital-primary);
    box-shadow: none;
}

.phone-search-box .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}