@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* Font family is set by the theme (Inter) - do not override here */

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

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

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

/* ===========================================
   BLAZOR RECONNECTION UI - Non-intrusive Toast Style
   =========================================== */

/* Hide by default */
#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

/* Show as a subtle toast at top of screen */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-attempting,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    justify-content: center !important;
    padding: 0.5rem !important;
    pointer-events: none !important;
}

#components-reconnect-modal .reconnect-content {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    pointer-events: auto !important;
    animation: slideDown 0.3s ease-out !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
#components-reconnect-modal .reconnect-spinner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid rgba(99, 102, 241, 0.3) !important;
    border-top-color: #6366f1 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

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

/* Messages */
#components-reconnect-modal .reconnect-message {
    color: #e2e8f0 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

#components-reconnect-modal .reconnect-status {
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
}

/* Failed state - show reload button */
#components-reconnect-modal.components-reconnect-failed .reconnect-content,
#components-reconnect-modal.components-reconnect-rejected .reconnect-content {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    display: none !important;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-message::after,
#components-reconnect-modal.components-reconnect-rejected .reconnect-message::after {
    content: " Tap to reload." !important;
    color: #6366f1 !important;
    cursor: pointer !important;
}

/* Improved error bar at bottom */
#blazor-error-ui {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-top: 3px solid #ef4444 !important;
    color: #f1f5f9 !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
    z-index: 99998 !important;
}

#blazor-error-ui .dismiss {
    color: #94a3b8 !important;
    font-size: 1.25rem !important;
}

/* Hide the default Blazor reconnect modal completely */
.components-reconnect-modal:not(#components-reconnect-modal) {
    display: none !important;
}

/* ===========================================
   MOBILE-FIRST RESPONSIVE LAYOUT
   Better screen utilization on mobile devices
   =========================================== */

/* Reduce side padding on mobile for better screen utilization */
@media (max-width: 767.98px) {
    .main-content {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .main-content .container-fluid,
    .app-content .container-fluid {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    /* Reduce card padding on mobile for more content space */
    .main-content .card > .card-body,
    .app-content .card > .card-body {
        padding: 0.75rem !important;
    }
    
    /* Compact card headers on mobile */
    .main-content .card > .card-header,
    .app-content .card > .card-header {
        padding: 0.5rem 0.75rem !important;
    }
}

/* Slightly more padding on tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-content {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .main-content .container-fluid,
    .app-content .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* ===========================================
   MEDICORE COMPONENT STYLES (mc-* namespace)
   Centralized styles for Document Control module
   =========================================== */

/* Compact Tables - for dense data display */
.mc-compact-table tbody tr {
    height: 42px;
    line-height: 1.1;
}

.mc-compact-table tbody td {
    padding: 0.2rem 0.5rem !important;
    vertical-align: middle;
    font-size: 0.8125rem;
}

.mc-compact-table thead th {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom-width: 2px;
}

.mc-compact-table .badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    font-weight: 500;
}

/* Compact action buttons in tables */
.mc-compact-table .btn-group .btn,
.mc-compact-table .btn-group-sm .btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
}

/* ===========================================
   STANDARDIZED TABLE HEADERS (Site-wide)
   Apply to all tables for consistent look
   =========================================== */
.table thead th {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* List Cards - clickable cards in lists */
.mc-list-card {
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mc-list-card:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Small Badges - for compact metadata display */
.mc-badge-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    font-weight: 500;
}

/* Extra small badges for mobile */
.mc-badge-xs {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    font-weight: 500;
}

/* Page titles with icons */
.mc-page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.mc-page-title .bi {
    color: var(--bs-primary);
}

/* Muted metadata text */
.mc-meta {
    font-size: 0.875rem;
    color: var(--bs-secondary);
}

/* Action overflow menu button */
.mc-overflow-btn {
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

/* Consistent card title styling */
.mc-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0;
}

/* Small uppercase labels for metadata */
.mc-label-sm {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--bs-secondary);
    display: block;
}

/* Large badge for status indicators */
.mc-badge-lg {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Document Content - for rendered HTML content in documents */
.mc-document-content {
    line-height: 1.6;
}

.mc-document-content h1,
.mc-document-content h2,
.mc-document-content h3,
.mc-document-content h4,
.mc-document-content h5,
.mc-document-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.mc-document-content p {
    margin-bottom: 1rem;
}

.mc-document-content ul,
.mc-document-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.mc-document-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.mc-document-content table th,
.mc-document-content table td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.mc-document-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Document Content Preview - enhanced styling for sign-off preview */
.mc-document-preview {
    line-height: 1.7;
    font-size: 0.95rem;
}

.mc-document-preview h1,
.mc-document-preview h2,
.mc-document-preview h3,
.mc-document-preview h4,
.mc-document-preview h5,
.mc-document-preview h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #212529;
}

.mc-document-preview h1 {
    font-size: 1.75rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.mc-document-preview h2 {
    font-size: 1.5rem;
}

.mc-document-preview h3 {
    font-size: 1.25rem;
}

.mc-document-preview p {
    margin-bottom: 1rem;
    color: #495057;
}

.mc-document-preview ul,
.mc-document-preview ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.mc-document-preview table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.mc-document-preview table th,
.mc-document-preview table td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.mc-document-preview table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.mc-document-preview img {
    max-width: 100%;
    height: auto;
}

/* Scrollable preview container */
.mc-preview-scroll {
    max-height: 600px;
    overflow-y: auto;
}

/* Scrollable content container - short */
.mc-scroll-sm {
    max-height: 400px;
    overflow-y: auto;
}

/* Fixed width input for inline controls */
.mc-input-fixed {
    width: 250px;
}

/* Signature image constraints */
.mc-signature-img {
    max-height: 50px;
    max-width: 150px;
}

.mc-signature-img-lg {
    max-height: 100px;
    border: 1px solid #dee2e6;
}

/* Signature canvas styling */
.mc-signature-canvas {
    width: 100%;
    height: 150px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.mc-signature-canvas-lg {
    width: 100%;
    height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
}

/* Placeholder container for empty signature */
.mc-signature-placeholder {
    width: 100%;
    height: 150px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mc-signature-placeholder-lg {
    width: 100%;
    height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Loading spinner - large */
.mc-spinner-lg {
    width: 3rem;
    height: 3rem;
}

/* Center container for loading states */
.mc-center-container {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 
 * Mobile cards: Visual separation through spacing and borders only.
 * Zebra striping is handled by Bootstrap's table-striped for tables.
 * Cards use mb-2 spacing and card borders for visual separation.
 */

/* Small text alert for debug/info boxes */
.mc-alert-sm {
    font-size: 0.875rem;
}

/* Clickable summary element */
.mc-clickable {
    cursor: pointer;
}

/* Fixed-width column for action buttons */
.mc-col-actions {
    width: 100px;
}

/* ===========================================
   DARK THEME - Document Content Tables
   =========================================== */
[data-theme-mode="dark"] .mc-document-content table,
[data-theme-mode="dark"] .mc-document-preview table {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme-mode="dark"] .mc-document-content table th,
[data-theme-mode="dark"] .mc-document-content table td,
[data-theme-mode="dark"] .mc-document-preview table th,
[data-theme-mode="dark"] .mc-document-preview table td {
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme-mode="dark"] .mc-document-content table th,
[data-theme-mode="dark"] .mc-document-preview table th {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

[data-theme-mode="dark"] .mc-document-content table tr:nth-child(even),
[data-theme-mode="dark"] .mc-document-preview table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme-mode="dark"] .mc-document-content table tr:hover,
[data-theme-mode="dark"] .mc-document-preview table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme-mode="dark"] .mc-document-content h1,
[data-theme-mode="dark"] .mc-document-content h2,
[data-theme-mode="dark"] .mc-document-content h3,
[data-theme-mode="dark"] .mc-document-content h4,
[data-theme-mode="dark"] .mc-document-content h5,
[data-theme-mode="dark"] .mc-document-content h6,
[data-theme-mode="dark"] .mc-document-preview h1,
[data-theme-mode="dark"] .mc-document-preview h2,
[data-theme-mode="dark"] .mc-document-preview h3,
[data-theme-mode="dark"] .mc-document-preview h4,
[data-theme-mode="dark"] .mc-document-preview h5,
[data-theme-mode="dark"] .mc-document-preview h6 {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme-mode="dark"] .mc-document-content p,
[data-theme-mode="dark"] .mc-document-preview p {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme-mode="dark"] .mc-document-preview h1 {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}