/* Custom CSS for CRM Application */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

/* Dashboard cards */
.dashboard-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.clickable-card small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    transition: opacity 0.2s;
}

.clickable-card:hover small {
    opacity: 1;
}

/* Calendar */
.fc-event {
    cursor: pointer;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

/* Status badges */
.badge-available {
    background-color: var(--success-color);
}

.badge-unavailable {
    background-color: var(--danger-color);
}

.badge-tentative {
    background-color: var(--warning-color);
}

.badge-requested {
    background-color: var(--info-color);
}

.badge-pending-fill {
    background-color: var(--warning-color);
}

.badge-assigned {
    background-color: #0dcaf0;
}

.badge-cancelled {
    background-color: var(--secondary-color);
}

/* Compliance status */
.compliance-valid {
    color: var(--success-color);
}

.compliance-expiring {
    color: var(--warning-color);
}

.compliance-expired {
    color: var(--danger-color);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Select2 customizations */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0.25rem 0 0;
    border-radius: 0.25rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 0.25rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffc107;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #dee2e6;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #0d6efd;
    color: white;
}

/* Help/Tooltip system */
.help-box {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    position: relative;
}

.help-box.collapsed {
    padding: 0;
    border: none;
    background: transparent;
}

.help-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.help-box.collapsed .help-box-header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
}

.help-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #0066cc;
    font-size: 0.95rem;
}

.help-box.collapsed .help-box-title {
    font-size: 0.85rem;
    color: #6c757d;
}

.help-box-toggle {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 1.2rem;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.help-box.collapsed .help-box-toggle {
    color: #6c757d;
}

.help-box-toggle:hover {
    color: #004080;
}

.help-box.collapsed .help-box-toggle {
    transform: rotate(180deg);
}

.help-box-content {
    margin-top: 8px;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.6;
    display: none;
}

.help-box:not(.collapsed) .help-box-content {
    display: block;
}

.help-box.collapsed .help-box-content {
    display: none;
}

.help-box-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.help-box-content li {
    margin-bottom: 4px;
}

.help-box-content strong {
    color: #212529;
}

/* Mobile shift cards */
.shift-card-mobile {
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #dee2e6;
}

.shift-card-mobile:hover {
    background-color: rgba(0, 102, 204, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.shift-card-mobile:active {
    background-color: rgba(0, 102, 204, 0.1);
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Mobile optimization for locum dashboard */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Improve table readability on mobile */
    .table-responsive table {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Stack cards vertically on mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Make buttons more touch-friendly */
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
        min-height: 48px;
    }
    
    /* Improve touch targets for all buttons */
    .btn {
        min-height: 44px;
    }
    
    /* Optimize card headers on mobile */
    .card-header h5 {
        font-size: 1rem;
    }
    
    /* Better spacing for mobile */
    .row.mt-4 {
        margin-top: 1rem !important;
    }
    
    .row.mt-3 {
        margin-top: 0.75rem !important;
    }
    
    /* Optimize alert messages */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    /* Better badge visibility */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.5em;
    }
    
    /* Mobile shift card enhancements */
    .shift-card-mobile h6 {
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    .shift-card-mobile .small {
        font-size: 0.85rem;
    }
}

/* Modal size override */
@media (min-width: 1200px) {
    .modal-xl {
        --bs-modal-width: 1500px;
    }
}

/* Nested Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-item.dropdown-toggle {
    padding-right: 2rem;
    position: relative;
}

.dropdown-submenu .dropdown-item.dropdown-toggle::after {
    content: "\F285"; /* Bootstrap icon chevron-right */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    transition: transform 0.2s ease;
}

.dropdown-submenu .dropdown-item.dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(90deg);
}

.dropdown-submenu .collapse,
.dropdown-submenu .collapsing {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.dropdown-submenu .collapse .dropdown-item,
.dropdown-submenu .collapsing .dropdown-item {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.dropdown-submenu .collapse .dropdown-item:hover,
.dropdown-submenu .collapsing .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Dark mode support for nested dropdowns */
[data-theme="dark-v1"] .dropdown-submenu .collapse,
[data-theme="dark-v1"] .dropdown-submenu .collapsing {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark-v1"] .dropdown-submenu .collapse .dropdown-item:hover,
[data-theme="dark-v1"] .dropdown-submenu .collapsing .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   HELP OFFCANVAS PANEL
   ============================================================ */
.help-panel-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.help-panel-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.help-panel-intro {
    background-color: #f8f9fa;
}

.help-accordion-btn {
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
}

.help-accordion-btn:not(.collapsed) {
    background-color: #e8f0fe;
    color: #0d6efd;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.help-step:last-child {
    border-bottom: none;
}

.help-step-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.05rem;
}

.help-step-text {
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
}

.help-tip-box {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    padding: 0.65rem 0.85rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.82rem;
    margin: 0.5rem 0;
}

.help-tip-box.info {
    background: #e3f2fd;
    border-left-color: #0d6efd;
}

.help-tip-box.danger {
    background: #fdecea;
    border-left-color: #dc3545;
}

.help-tip-box.success {
    background: #e8f5e9;
    border-left-color: #28a745;
}

.help-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    padding: 0.9rem 1rem 0.4rem;
    margin: 0;
}

/* Dark mode support for help panel */
[data-theme="dark-v1"] .help-panel-intro,
[data-theme="dark-v2"] .help-panel-intro {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark-v1"] .help-accordion-btn:not(.collapsed),
[data-theme="dark-v2"] .help-accordion-btn:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.15);
}

[data-theme="dark-v1"] .help-tip-box,
[data-theme="dark-v2"] .help-tip-box {
    background: rgba(255, 193, 7, 0.1);
}

[data-theme="dark-v1"] .help-tip-box.info,
[data-theme="dark-v2"] .help-tip-box.info {
    background: rgba(13, 110, 253, 0.1);
}

[data-theme="dark-v1"] .help-step,
[data-theme="dark-v2"] .help-step {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   8x8 Click-to-Call Phone Numbers
   ======================================== */

/* Clickable phone number links */
.clickable-phone {
    color: #0d6efd;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.clickable-phone:hover {
    color: #0a58ca;
    background-color: rgba(13, 110, 253, 0.1);
    text-decoration: none;
}

.clickable-phone:active {
    transform: scale(0.98);
}

.clickable-phone i {
    font-size: 0.9em;
}

/* 8x8-specific styling */
.clickable-phone.use-8x8::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3E%3Cpath d='M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.clickable-phone.use-8x8:hover::after {
    opacity: 1;
}

/* Dark mode support */
[data-theme="dark-v1"] .clickable-phone,
[data-theme="dark-v2"] .clickable-phone {
    color: #6ea8fe;
}

[data-theme="dark-v1"] .clickable-phone:hover,
[data-theme="dark-v2"] .clickable-phone:hover {
    color: #9ec5fe;
    background-color: rgba(110, 168, 254, 0.15);
}

[data-theme="dark-v1"] .clickable-phone.use-8x8::after,
[data-theme="dark-v2"] .clickable-phone.use-8x8::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3E%3Cpath d='M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z'/%3E%3C/svg%3E");
}

/* Responsive - smaller icon on mobile */
@media (max-width: 576px) {
    .clickable-phone {
        font-size: 0.9em;
    }
    
    .clickable-phone.use-8x8::after {
        width: 10px;
        height: 10px;
        margin-left: 3px;
    }
}

/* Copy-only content - hidden visually but included in clipboard when copied */
.copy-only {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    width: 1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: 0;
}

