/* Custom Styles for Baibua Visit */
body {
    font-family: 'Prompt', sans-serif;
}


/* Make sure the map takes appropriate height on mobile */
#map {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* --- Routing Machine Styles --- */
.leaflet-routing-container {
    display: none !important; /* Hide the default bulky routing instructions panel */
}

.visit-card {
    transition: transform 0.2s ease-in-out;
}

.visit-card:active {
    transform: scale(0.98);
}

/* --- High Visibility Student Badges --- */
.student-badge-marker {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    padding: 8px 12px;
    min-width: 180px;
    position: relative;
    border-left: 5px solid #0d6efd;
    transition: transform 0.2s;
    cursor: pointer;
}

.student-badge-marker:hover {
    transform: scale(1.05);
    z-index: 1000 !important;
}

.student-badge-marker.risk-none { border-left-color: #198754; }
.student-badge-marker.risk-low { border-left-color: #ffc107; }
.student-badge-marker.risk-medium { border-left-color: #fd7e14; }
.student-badge-marker.risk-high { border-left-color: #dc3545; }
.student-badge-marker.risk-critical { border-left-color: #dc3545; }

.badge-name {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-info {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

.badge-info i {
    width: 14px;
    text-align: center;
    margin-right: 4px;
    color: #0d6efd;
}

.badge-phone {
    font-weight: 600;
    color: #0d6efd;
}

/* Add a small arrow at the bottom of the badge */
.student-badge-marker::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

/* Visit Order Badge for Active Plan */
.visit-order-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    background: #0d6efd;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

/* --- Report Center Styles --- */
.report-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.progress-sm {
    height: 10px !important;
}

.sticky-top-custom {
    top: 80px;
    z-index: 100;
}

.progress-bar {
    width: 0;
}

/* Custom Risk Colors */
.bg-orange { background-color: #fd7e14 !important; }
.text-orange { color: #fd7e14 !important; }

/* Modal Enhancements */
#studentDetailModal .modal-content {
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#modal-student-photo {
    transition: transform 0.3s ease;
}

#modal-student-photo:hover {
    transform: scale(1.1);
}

.map-container {
    height: 500px;
    width: 100%;
}

.modal-header-glass {
    min-height: 120px;
}

/* Print Utilities */
@media print {
    .no-print {
        display: none !important;
    }
    
    .page-break {
        page-break-after: always;
    }
    
    body {
        background-color: white !important;
    }
    
}

/* --- Premium Modal & Table Styles --- */
.modal-premium-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-bottom: 0;
    padding: 1.5rem;
}

.modal-premium-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.table-modern {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-modern thead th {
    border-bottom: 0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    color: #8c98a4;
    padding-bottom: 1rem;
}

.table-modern tbody tr {
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    border-radius: 12px;
    background: white;
}

.table-modern tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.table-modern td {
    border: 0;
    padding: 1.25rem 0.75rem;
}

.table-modern td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-modern td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.status-badge-pill {
    padding: 0.5rem 1rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.btn-icon-hover {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-hover:hover {
    background-color: #f8f9fa;
    transform: scale(1.1);
}

/* --- Optimized Simplified Markers: Red Pin Style --- */
.student-badge-marker.marker-simplified {
    min-width: 0;
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    background-color: #dc3545 !important;
    transform: rotate(-45deg);
}

.student-badge-marker.marker-simplified::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: rotate(45deg);
}

.student-badge-marker.marker-simplified .badge-name, 
.student-badge-marker.marker-simplified .badge-info {
    display: none;
}

.student-badge-marker.marker-simplified::after {
    display: none;
}

/* Adjust order badge for simplified view */
.student-badge-marker.marker-simplified .visit-order-badge {
    top: -10px;
    left: -10px;
    width: 20px;
    height: 20px;
    font-size: 10px;
    border-width: 1px;
    transform: rotate(45deg);
}

/* --- Modern Bottom Navigation (Mobile) --- */
.bottom-nav {
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    z-index: 1050;
    transition: all 0.3s ease;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    width: 20%;
    transition: all 0.2s ease;
    padding: 5px 0;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.bottom-nav-item.active {
    color: #0d6efd;
}

.bottom-nav-item.active i {
    transform: translateY(-5px);
    text-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* Adjust page content padding so bottom nav doesn't overlap */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 100px !important;
    }
}

/* --- Premium SweetAlert2 Tweaks --- */
.swal2-popup {
    border-radius: 20px !important;
    font-family: 'Prompt', sans-serif !important;
}

.swal2-styled.swal2-confirm {
    background-color: #0d6efd !important;
    border-radius: 12px !important;
    padding: 10px 25px !important;
}

.swal2-styled.swal2-cancel {
    border-radius: 12px !important;
}


/* --- Mobile Responsive Typography (Per User Request) --- */
@media (max-width: 575.98px) {
    html {
        font-size: 14px; /* Reduced base for better mobile fit */
    }
    
    h4 { font-size: 1.25rem !important; }
    h5 { font-size: 1.1rem !important; }
    h6 { font-size: 1rem !important; }

    .card-header h5 {
        font-size: 1rem !important;
    }

    .btn:not(.btn-icon-hover) {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }

    .badge {
        font-size: 0.7rem !important;
        padding: 0.4em 0.7em !important;
    }

    /* Improve Visit Plan List on small screens */
    #active-plan-items .list-group-item {
        padding: 12px !important;
    }
    
    .visit-item-content {
        flex-grow: 1;
        min-width: 0; /* Allow text truncate to work */
    }

    .visit-item-actions {
        display: flex;
        gap: 0.5rem;
        margin-left: auto;
    }

    /* For extra small phones, stack the buttons if needed */
    @media (max-width: 380px) {
        #active-plan-items .d-flex {
            flex-wrap: wrap;
        }
        .visit-item-actions {
            width: 100%;
            margin-top: 10px;
            justify-content: flex-end;
            padding-left: 45px; /* Alignment with name */
        }
    }
}

/* Glassmorphism for Top Navbar */
.navbar.glass {
    background: rgba(13, 110, 253, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-link.active { color: #fff !important; font-weight: 700; position: relative; }
.nav-link.active::after { content: ''; position: absolute; bottom: -2px; left: 8px; right: 8px; height: 3px; background: #fff; border-radius: 10px; }
