/* Custom styles for Healthcare Staffing Management */

/* Standard Navy Blue Theme */
body {
    background-color: #000030 !important;
    color: #ffffff !important;
}

.container, .container-fluid {
    background-color: #000030 !important;
}

/* Ensure main content area matches exactly */
html {
    background-color: #000030 !important;
}

/* Enhanced Navbar styling */
.navbar {
    background-color: #1a1a1a !important;
    border-bottom: 2px solid #4B9CD3;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: #4B9CD3 !important;
}

.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #4B9CD3 !important;
    background-color: rgba(75, 156, 211, 0.1) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: #4B9CD3 !important;
    background-color: rgba(75, 156, 211, 0.15) !important;
}

.navbar-toggler {
    border: none;
    padding: 6px 10px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-text {
    color: #cccccc !important;
    font-size: 0.875rem;
}

/* Dropdown menu enhancements */
.dropdown-menu {
    background-color: #2a2a2a !important;
    border: 1px solid #4B9CD3 !important;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-top: 8px;
}

.dropdown-item {
    color: #ffffff !important;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
}

.dropdown-item:hover {
    background-color: #4B9CD3 !important;
    color: #ffffff !important;
    transform: translateX(4px);
}

.dropdown-header {
    color: #4B9CD3 !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 16px;
}

.dropdown-divider {
    border-color: #444444 !important;
    margin: 8px 0;
}

/* Mobile navigation improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #444444;
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        border-radius: 8px;
        margin: 2px 0;
        padding: 12px 16px !important;
    }
}

/* Card styling for dark theme */
.card {
    background-color: #3a3a3a !important;
    border: 1px solid #555555 !important;
    color: #ffffff !important;
}

.card-header {
    background-color: #444444 !important;
    border-bottom: 1px solid #555555 !important;
    color: #ffffff !important;
}

.card-body {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
}

.card-footer {
    background-color: #444444 !important;
    border-top: 1px solid #555555 !important;
    color: #ffffff !important;
}

/* Color-coded table rows */
.table-danger {
    --bs-table-bg: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
}

.table-info {
    --bs-table-bg: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.2);
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .fa-3x {
        font-size: 2em;
    }
}

/* Status badges */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Form styling for dark theme */
.form-control,
.form-select {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #666666 !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
    color: #000000 !important;
    background-color: #ffffff !important;
}

.form-control::placeholder {
    color: #666666 !important;
    opacity: 0.7;
}

.form-label {
    color: #ffffff !important;
    font-weight: 500;
}

/* Dark theme for form validation states */
.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

.form-control.is-valid {
    border-color: #28a745 !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Loading state for export buttons */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}

/* Footer styling */
footer {
    margin-top: auto;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Enhanced table responsiveness */
.table-responsive {
    border-radius: 0.375rem;
}

/* Icon spacing improvements */
.fa-square {
    font-size: 1rem;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Navigation active state */
.navbar-nav .nav-link.active {
    font-weight: 600;
}

/* Stats card improvements */
.card.bg-danger,
.card.bg-info,
.card.bg-primary {
    border: none;
}

.card.bg-danger .card-body,
.card.bg-info .card-body,
.card.bg-primary .card-body {
    padding: 2rem;
}

/* Form section headers - ensure visibility in dark theme */
.card.bg-light .card-header {
    background-color: #495057 !important;
    border-bottom: 1px solid #6c757d !important;
    color: #ffffff !important;
}

.card.bg-light .card-header h6 {
    color: #ffffff !important;
    font-weight: 600;
}

.card.bg-light .card-header i {
    color: #ffffff !important;
}

.card.bg-light {
    background-color: #6c757d !important;
    border: 1px solid #495057 !important;
}

.card.bg-light .card-body {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

.card.bg-light .form-label {
    color: #ffffff !important;
    font-weight: 500;
}

/* Detailed View table with dark theme */
.table {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}

.table td {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}

.table td strong {
    color: #ffffff !important;
}

.table td small {
    color: #cccccc !important;
}

.table td .text-muted {
    color: #aaaaaa !important;
    opacity: 1;
}

/* Table headers with dark theme */
.table th {
    background-color: #444444 !important;
    color: #ffffff !important;
    font-weight: 600;
    border-bottom: 2px solid #666666 !important;
    border-color: #555555 !important;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background-color: #404040 !important;
}

/* Table hover effects for dark theme */
.table-hover tbody tr:hover td {
    background-color: #505050 !important;
    color: #ffffff !important;
}

/* Colored row backgrounds with light text for dark theme */
.table-danger td {
    background-color: rgba(220, 53, 69, 0.3) !important;
    color: #ffffff !important;
}

.table-info td {
    background-color: rgba(13, 202, 240, 0.3) !important;
    color: #ffffff !important;
}

/* Alert styling for dark theme */
.alert {
    background-color: #444444 !important;
    border: 1px solid #666666 !important;
    color: #ffffff !important;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.3) !important;
    border-color: rgba(40, 167, 69, 0.5) !important;
    color: #ffffff !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.3) !important;
    border-color: rgba(220, 53, 69, 0.5) !important;
    color: #ffffff !important;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.3) !important;
    border-color: rgba(13, 202, 240, 0.5) !important;
    color: #ffffff !important;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.3) !important;
    border-color: rgba(255, 193, 7, 0.5) !important;
    color: #ffffff !important;
}

/* Modal styling for dark theme */
.modal-content {
    background-color: #3a3a3a !important;
    border: 1px solid #555555 !important;
    color: #ffffff !important;
}

.modal-header {
    background-color: #444444 !important;
    border-bottom: 1px solid #555555 !important;
    color: #ffffff !important;
}

.modal-footer {
    background-color: #444444 !important;
    border-top: 1px solid #555555 !important;
    color: #ffffff !important;
}

/* Button hover effects adjustment for dark theme */
.btn:hover {
    filter: brightness(1.1);
}

/* Text colors for dark theme */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

p, span, div {
    color: inherit;
}

/* Ensure links are visible */
a {
    color: #66b3ff !important;
}

a:hover {
    color: #4da3ff !important;
}

/* Breadcrumb styling for dark theme */
.breadcrumb {
    background-color: #444444 !important;
    border: 1px solid #555555 !important;
}

.breadcrumb-item a {
    color: #66b3ff !important;
}

.breadcrumb-item.active {
    color: #cccccc !important;
}

/* Pagination styling for dark theme */
.pagination .page-link {
    background-color: #444444 !important;
    border-color: #555555 !important;
    color: #ffffff !important;
}

.pagination .page-link:hover {
    background-color: #555555 !important;
    border-color: #666666 !important;
    color: #ffffff !important;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

/* Dropdown styling for dark theme */
.dropdown-menu {
    background-color: #3a3a3a !important;
    border: 1px solid #555555 !important;
}

.dropdown-item {
    color: #ffffff !important;
    background-color: transparent !important;
}

.dropdown-item:hover {
    background-color: #505050 !important;
    color: #ffffff !important;
}

/* List group styling for dark theme */
.list-group-item {
    background-color: #3a3a3a !important;
    border: 1px solid #555555 !important;
    color: #ffffff !important;
}

.list-group-item:hover {
    background-color: #444444 !important;
}

/* Badge adjustments for dark theme */
.badge {
    color: #ffffff !important;
}

/* Input group styling for dark theme */
.input-group-text {
    background-color: #444444 !important;
    border: 1px solid #666666 !important;
    color: #ffffff !important;
}

/* Ensure text in cards and other elements are white */
.card-title, .card-text {
    color: #ffffff !important;
}

/* Override any Bootstrap text utilities that might conflict */
.text-dark {
    color: #ffffff !important;
}

.text-muted {
    color: #aaaaaa !important;
}

/* Organization logo background matching app theme exactly */
.organization-logo {
    background-color: #000030 !important;
    /* Remove padding and border-radius for seamless integration */
}

/* Status boxes - force red for needs and blue for available */
.card.bg-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.card.bg-danger .card-body {
    background-color: #dc3545 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card.bg-primary {
    background-color: #4B9CD3 !important;
    border-color: #4B9CD3 !important;
}

.card.bg-primary .card-body {
    background-color: #4B9CD3 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Prevent word wrapping in status boxes */
.card.bg-danger .card-body small,
.card.bg-primary .card-body small {
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 500;
}

.card.bg-danger .row.text-center .col-6,
.card.bg-primary .row.text-center .col-6 {
    min-width: 0;
    overflow: visible;
}

.table tbody tr td:nth-child(10) small i {
    color: #6c757d !important;
}

/* Date picker enhancements */
input[type="date"] {
    cursor: pointer;
    position: relative;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3e%3cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1zm11-1a1 1 0 0 1-1-1V1a1 1 0 1 1 2 0v1a1 1 0 0 1-1 1zM4 1a1 1 0 0 1-1-1V1a1 1 0 1 1 2 0v1a1 1 0 0 1-1 1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 45px;
}

/* Hide the native calendar picker indicator on webkit browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
}

input[type="date"]:hover {
    background-color: #f8f9fa;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

input[type="date"]:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Ensure date input is fully clickable */
input[type="date"]::-webkit-inner-spin-button {
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* PWA and Mobile Optimizations */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Hide scrollbars in standalone mode */
    ::-webkit-scrollbar {
        display: none;
    }
    
    /* Add padding for status bar on iOS */
    .navbar {
        padding-top: env(safe-area-inset-top, 0);
    }
}

/* Mobile-first responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Larger touch targets */
    .nav-link {
        padding: 12px 16px;
    }
    
    /* Better mobile table display */
    .table-responsive {
        border-radius: 0.375rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-friendly stats cards */
    .display-3 {
        font-size: 2.5rem;
    }
    
    /* Improved form spacing on mobile */
    .row.mb-3 {
        margin-bottom: 1.5rem !important;
    }
}

/* Install button styling */
#installBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4B9CD3;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    z-index: 1000;
    display: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#installBtn:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    /* Larger touch targets for mobile */
    .navbar-toggler {
        padding: 8px 12px;
    }
    
    .dropdown-toggle::after {
        margin-left: 0.5em;
    }
}

/* Force correct badge colors for calendar - override dark theme */
.badge.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Ensure calendar badges are properly colored */
.calendar-day .badge.bg-danger,
.badge.bg-danger.badge-sm {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.calendar-day .badge.bg-primary,
.badge.bg-primary.badge-sm {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Past date dimming effects for chronological ordering */
.past-date {
    opacity: 0.45 !important;
    filter: grayscale(0.2);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.past-date:hover {
    opacity: 0.65 !important;
    filter: grayscale(0.1);
}

/* Today highlight */
.today {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    position: relative;
}

.today::before {
    content: "TODAY";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--bs-primary);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
}

/* Safe area adjustments for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }
    
    footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}
