/* ClinicCare — Custom Styles - Mobile-First Responsive */

/* ── Global Mobile-First Improvements ── */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

/* Improve touch targets on mobile */
button, a, .btn {
    min-height: 44px;
}

/* ── Sidebar ── */
.sidebar .list-group-item {
    border: none;
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    transition: background-color 0.15s;
    font-size: 0.95rem;
}

.sidebar .list-group-item:hover {
    background-color: #e9ecef;
}

.sidebar .list-group-item.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* ── Dashboard stat cards ── */
.stat-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.12) !important;
}

/* ── Category select cards ── */
.category-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 120px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.15) !important;
}

/* ── Leaflet map containers ── */
#map, #hospital-map {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    width: 100%;
    height: 400px;
}

/* ── Queue number badge ── */
.queue-badge {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ── Role badges in navbar ── */
.role-badge {
    font-size: 0.7rem;
    vertical-align: middle;
}

/* ── Approval status banner ── */
.approval-banner {
    border-left: 4px solid #ffc107;
}

/* ── Table row hover ── */
.table-hover tbody tr {
    transition: background-color 0.1s;
}

/* ── Form field focus ── */
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15);
}

/* ── Responsive Typography ── */
h1, .h1 { font-size: 1.5rem; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.1rem; }

/* ── Mobile-First: Tablets & Larger ── */
@media (min-width: 576px) {
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
}

/* ── Tablets (md breakpoint) ── */
@media (min-width: 768px) {
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.75rem; }
    h3, .h3 { font-size: 1.5rem; }
}

/* ── Responsive Container Padding ── */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
}

/* ── Responsive Map Height ── */
@media (max-width: 576px) {
    #map, #hospital-map {
        height: 250px !important;
    }
}

@media (max-width: 768px) {
    #map, #hospital-map {
        height: 300px !important;
    }
}

/* ── Responsive Table: Card Layout on Mobile ── */
@media (max-width: 768px) {
    .table-responsive {
        border: 0;
    }
    
    .dash-table {
        font-size: 0.8rem;
    }
    
    .dash-table thead {
        display: none;
    }
    
    .dash-table tbody, .dash-table tr, .dash-table td {
        display: block;
        width: 100%;
    }
    
    .dash-table tr {
        border: 1px solid #e8eef8;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .dash-table td {
        padding: 0.5rem 0;
        border: none;
        text-align: right;
        position: relative;
        padding-left: 50%;
    }
    
    .dash-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        font-weight: 700;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

/* ── Responsive Buttons ── */
@media (max-width: 576px) {
    .d-grid.gap-2.d-sm-flex {
        flex-direction: column;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .btn-lg {
        padding: 0.85rem 1rem;
    }
    
    .btn-mini {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ── Responsive Form Inputs ── */
@media (max-width: 576px) {
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .form-label {
        font-size: 0.95rem;
    }
}

/* ── Responsive Dashboard Sidebar ── */
@media (max-width: 768px) {
    .dash-page .row.g-4 {
        gap: 1.5rem !important;
    }
    
    .dash-sidebar-card {
        position: sticky;
        top: 80px;
        z-index: 100;
    }
    
    .dash-sidebar-uname {
        max-width: 100px;
    }
}

@media (max-width: 576px) {
    .dash-sidebar-header {
        flex-wrap: wrap;
    }
    
    .dash-title {
        font-size: 1.3rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
    
    .stat-meta .stat-value {
        font-size: 1.5rem;
    }
}

/* ── Responsive Time Slots Grid ── */
.available-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .available-times-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.4rem;
    }
    
    .time-slot-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .available-times-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }
}

/* ── Responsive Doctor List/Cards ── */
.doctor-card, .hospital-card {
    transition: transform 0.2s;
}

@media (max-width: 576px) {
    .doctor-card, .hospital-card {
        margin-bottom: 1rem;
    }
    
    .doctor-card .card-body, .hospital-card .card-body {
        padding: 1rem;
    }
}

.doctor-card:hover, .hospital-card:hover {
    transform: translateY(-2px);
}

/* ── Responsive Navbar Adjustments ── */
@media (max-width: 576px) {
    #mainNav {
        padding: 0.5rem 0;
    }
    
    .nav-brand-text {
        font-size: 1rem;
    }
    
    .nav-brand-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    #mainNav .nav-link {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.8rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* ── Responsive Modal ── */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 12px;
    }
}

/* ── Responsive Appointment Items ── */
@media (max-width: 576px) {
    .appt-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .appt-dr {
        font-size: 0.95rem;
    }
    
    .appt-spec, .appt-time {
        font-size: 0.8rem;
    }
}
