/* Healthcare Admin Panel - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #07050a 100%);
}

.login-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
}

.login-header i {
    margin-right: 0.5rem;
}

.login-body {
    padding: 2rem;
}

.form-floating>label {
    padding-left: 2.5rem;
}

.form-floating>label i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--border-radius);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modern Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #1a1d29 0%, #16213e 100%);
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.sidebar-brand:hover {
    color: white;
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

.sidebar-nav .nav {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 1rem;
}

.sidebar-nav .nav-item {
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 2px;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-user-info .user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.sidebar-user-info .user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.sidebar-user-info .user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.sidebar-brand-image {
    text-align: center;
    padding: 1rem 0;
}

.sidebar-brand-image img {
    max-width: 120px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-brand-image img:hover {
    opacity: 1;
}

.sidebar-brand-image .brand-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Mobile hamburger menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: 2px solid white;
    border-radius: 0.75rem;
    padding: 0;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 56px;
    height: 56px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.3), 0 6px 20px rgba(13, 110, 253, 0.4);
}

.mobile-menu-toggle i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile sidebar close button */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    padding: 0;
    color: white;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-close:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.sidebar-close:active {
    transform: rotate(90deg) scale(0.95);
}

.sidebar-close i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 991.98px) {
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Main content adjustment */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    padding: 2rem;
    padding-left: 2.7rem !important;
    background: #f8f9fa;
}

/* Sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

.table-responsive {
    overflow-x: auto;
}

.table.table-hover {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .table.table-hover {
        white-space: normal;
    }
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.status-registered {
    background-color: var(--info-color);
}

.status-in-progress {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.status-completed {
    background-color: var(--success-color);
}

.status-cancelled {
    background-color: var(--danger-color);
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
}

.alert i {
    margin-right: 0.5rem;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 85vw;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {

        0%,
        100% {
            box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        50% {
            box-shadow: 0 8px 28px rgba(13, 110, 253, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
        }
    }

    .sidebar-overlay {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 1rem !important;
        padding-top: 5rem !important;
        /* Space for mobile toggle */
    }

    .login-card {
        margin: 1rem;
    }

    .login-header,
    .login-body {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar-nav .nav-link {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .sidebar-brand {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 0.5rem !important;
        padding-top: 1rem !important;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 
Mini Map Styles */
.mini-map-container {
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mini-map-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.mini-map-container img {
    transition: opacity 0.3s ease;
}

.mini-map-container:hover img {
    opacity: 0.9;
}

/* Location Modal Styles */
#locationModal .modal-body {
    padding: 1.5rem;
}

#fullLocationMap {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

/* Mapbox GL Controls */
.mapboxgl-ctrl-group {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mapboxgl-popup-content {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapboxgl-marker {
    cursor: pointer;
}