/* Ambulance Information Page Styles */
/* Mirrors hospitals.css with ambulance/emergency theme (red accent) */

/* CRITICAL: Prevent all drag behavior globally */
html, body, * {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -o-user-select: none !important;
    user-select: none !important;
}

/* Allow text selection for input fields and content areas */
input, textarea, .content-area, .info-card p, .info-card h3, .info-card h4, .tip-description, .facility-name, .content p, .content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -o-user-select: text !important;
    user-select: text !important;
}

.ambulance-page {
    min-height: calc(100dvh - 220px);
    padding: 24px;
    background: var(--muted-bg);
}

.ambulance-container {
    max-width: 1200px;
    margin: 0 auto;
}

.ambulance-header {
    text-align: center;
    margin-bottom: 40px;
}

.ambulance-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.ambulance-sub {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Register Button in Header */
.ambulance-header .register-btn {
    background: #dc2626 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    margin-top: 16px !important;
}

.ambulance-header .register-btn:hover {
    background: #b91c1c !important;
}

.ambulance-header .register-btn i {
    font-size: 16px !important;
}

/* ===== Emergency Number Cards (112, 108, 102) - All Cities ===== */
.ambulance-emergency-numbers {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.ambulance-emergency-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ambulance-emergency-sub {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
}
.ambulance-emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.ambulance-emergency-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.ambulance-emergency-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}
.ambulance-emergency-number {
    font-size: 2rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 6px;
    line-height: 1.2;
}
.ambulance-emergency-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
}

/* ===== Find Ambulances (Google-like: map + list) ===== */
.find-ambulances-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.find-ambulances-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.find-ambulances-heading i {
    color: #dc2626;
}
.find-ambulances-sub {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
}
.find-ambulances-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}
.find-ambulances-bar .find-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.15s;
}
.find-ambulances-bar .find-btn-nearme {
    background: #dc2626;
    color: #fff;
}
.find-ambulances-bar .find-btn-nearme:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}
.find-ambulances-bar .find-btn-city {
    background: #0ea5e9;
    color: #fff;
}
.find-ambulances-bar .find-btn-city:hover {
    background: #0284c7;
    transform: translateY(-1px);
}
.find-ambulances-bar .find-city-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}
.find-ambulances-bar .find-city-input {
    flex: 1;
    min-width: 160px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.find-ambulances-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    min-height: 400px;
}
.find-ambulances-list-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}
.find-ambulances-list-placeholder {
    padding: 40px 24px;
    text-align: center;
    color: #6b7280;
}
.find-ambulances-list-placeholder i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 12px;
    display: block;
}
.find-ambulances-list-placeholder.hidden {
    display: none;
}
.find-ambulances-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    max-height: 420px;
}
.find-ambulances-list li {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s;
    background: #fff;
}
.find-ambulances-list li:hover,
.find-ambulances-list li.active {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}
.find-ambulances-list li .list-item-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}
.find-ambulances-list li .list-item-addr {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 2px;
}
.find-ambulances-list li .list-item-distance {
    font-size: 12px;
    color: #dc2626;
    font-weight: 600;
}
.find-ambulances-map-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    min-height: 400px;
}
.ambulance-leaflet-map {
    width: 100%;
    height: 400px;
    background: #e2e8f0;
}
@media (max-width: 900px) {
    .find-ambulances-content {
        grid-template-columns: 1fr;
    }
    .find-ambulances-list-wrap {
        max-height: 280px;
    }
    .find-ambulances-list {
        max-height: 260px;
    }
    .ambulance-leaflet-map {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .ambulance-header .register-btn {
        width: 90% !important;
        max-width: 300px !important;
    }
    .search-filters .search-btn,
    .ambulance-page .search-btn {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-top: 8px !important;
        padding: 14px 24px !important;
    }
}

.search-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.filter-group select,
.filter-group input {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.search-filters .search-btn,
.ambulance-page .search-btn {
    background: #dc2626 !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.search-filters .search-btn:hover,
.ambulance-page .search-btn:hover {
    background: #b91c1c !important;
}

#header-container .search-btn,
.header-mid .search-btn,
.search-bar-container .search-btn,
.search-input-wrapper .search-btn,
.search-actions .search-btn,
#header-container label.search-btn,
.header-mid label.search-btn,
.search-bar-container label.search-btn,
.search-input-wrapper label.search-btn,
.search-actions label.search-btn {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    color: #1f2937 !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

#header-container .search-btn:hover,
.header-mid .search-btn:hover,
.search-bar-container .search-btn:hover,
.search-input-wrapper .search-btn:hover,
.search-actions .search-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.ambulance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.ambulance-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.ambulance-header-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ambulance-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
}

.ambulance-info {
    flex: 1;
}

.ambulance-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.ambulance-type {
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 8px;
}

.ambulance-address {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.ambulance-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 16px;
    width: 100%;
}

.ambulance-actions .action-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.btn-primary {
    background: #dc2626;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #b91c1c;
}

.btn-call {
    background: #10b981;
    color: #fff;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-call:hover {
    background: #059669;
    color: #fff;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-color);
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-report {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(245,158,11,0.2);
}

.btn-report:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.ambulance-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: var(--text-color);
}

.availability {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.available {
    background: #dcfce7;
    color: #166534;
}

.busy {
    background: #fef2f2;
    color: #dc2626;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #f3f4f6;
}

.page-btn.active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.ambulance-disclaimer {
    margin: 30px 0;
    padding: 0;
}

.ambulance-disclaimer .disclaimer-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal-overlay.show {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 700px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 25px;
}

.modal-overlay.details-modal {
    z-index: 10001;
}

.modal-container.details-modal {
    max-width: 800px;
    height: 95vh;
    display: flex;
    flex-direction: column;
}

.modal-header.details-modal {
    padding: 18px 20px;
    flex-shrink: 0;
}

.modal-body.details-modal {
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.success-message {
    display: none;
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #86efac;
}

.success-message.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-field { margin-bottom: 18px; }
.form-field.small { margin-bottom: 12px; }
.form-label { display: block; color: #374151; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.form-label.small { font-size: 0.9rem; }
.form-input, .form-textarea { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; box-sizing: border-box; }
.form-input.readonly { background: #f9fafb; color: #6b7280; }
.form-textarea { resize: vertical; font-family: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 12px; }
.form-section { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #e5e7eb; }
.section-title { color: #dc2626; font-size: 0.95rem; font-weight: 700; margin: 0 0 12px 0; }
.form-buttons { display: flex; gap: 12px; justify-content: flex-end; }
.btn-cancel { padding: 10px 20px; background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-submit { padding: 10px 20px; background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.form-input-file { padding: 8px; font-size: 0.9rem; cursor: pointer; }
.form-hint { display: block; font-size: 0.8rem; color: #6b7280; margin-top: 6px; }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .filter-row { grid-template-columns: 1fr; }
    .ambulance-grid { grid-template-columns: 1fr; }
    .search-filters { padding: 20px 16px; }
    .form-buttons { flex-direction: column; }
    .btn-cancel, .btn-submit { width: 100%; }
}

@media (max-width: 480px) {
    .ambulance-actions {
        gap: 4px;
    }
    .ambulance-actions .action-btn {
        padding: 7px 6px;
        font-size: 0.75rem;
    }
}
