/* نظام ملاجئ عبلين - ملف CSS */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.emergency-bar {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}



.shelter-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    z-index: 10;
}

.selected-shelter {
    background: #28a745 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4) !important;
    transform: scale(1.1);
    z-index: 5;
}

.user-marker {
    position: absolute;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
    animation: userPulse 2s infinite;
}

@keyframes userPulse {
    0% { box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4); }
    50% { box-shadow: 0 2px 12px rgba(0, 123, 255, 0.8); }
    100% { box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4); }
}

.shelter-info {
    display: none;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 15px;
    margin-top: 15px;
    border: 1px solid #bbdefb;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.shelter-info h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-size: 1.2rem;
}

.shelter-info p {
    margin: 5px 0;
    color: #424242;
    line-height: 1.6;
}

.distance-info {
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    border: 1px solid #ffcc02;
    font-weight: 600;
    color: #f57c00;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recalculate-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    min-height: 35px;
}

.recalculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4);
}

.emergency-contact {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #ffeaa7;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.1);
}

.emergency-contact h3 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emergency-contact .phone-number {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #856404;
    text-decoration: none;
    transition: all 0.3s ease;
}

.emergency-contact .phone-number:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shelter-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e0e6ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shelter-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #007bff;
}

.shelter-image-placeholder {
    width: 80px;
    height: 60px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    margin: 0 auto;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.image-modal img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.image-modal-title {
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 20px;
    text-align: center;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .content {
        padding: 20px;
    }
    
    .smart-map-section {
        padding: 20px;
    }
    
    #map {
        height: 400px;
    }
    
    .map-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-button {
        width: 100%;
        max-width: 250px;
        min-height: 48px;
        font-size: 16px;
    }
    
    .emergency-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .emergency-info {
        justify-content: center;
        gap: 10px;
    }
    
    .emergency-button {
        width: 100%;
        justify-content: center;
        font-size: 18px;
        padding: 15px 20px;
    }
    
    .digital-clock {
        font-size: 16px;
        min-width: 100px;
    }
    
    .share-location {
        font-size: 12px;
        padding: 8px 12px;
        min-height: 40px;
    }
}

.emergency-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.emergency-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 107, 107, 0.8); }
    100% { box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4); }
}

.emergency-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.digital-clock {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 15px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    min-width: 120px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.share-location {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.share-location:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

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

.main-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    background: linear-gradient(135deg, #171459 0%, #2d4a8a 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    opacity: 0.3;
}

.header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header .subtitle {
    margin: 10px 0 0 0;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.content {
    padding: 30px;
}

.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

thead {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
}

th {
    padding: 20px 15px;
    font-weight: 600;
    color: #171459;
    text-align: center;
    border-bottom: 2px solid #e0e6ff;
    font-size: 1.1rem;
}

tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 18px 15px;
    vertical-align: middle;
}

.shelter-name {
    font-weight: 600;
    color: #171459;
    font-size: 1.05rem;
}

.neighborhood {
    color: #666;
    line-height: 1.4;
}

.map-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    border: none;
    cursor: pointer;
    margin: 3px;
}

.map-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.waze-button {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    box-shadow: 0 4px 15px rgba(0, 153, 204, 0.3);
}

.waze-button:hover {
    background: linear-gradient(135deg, #0099cc 0%, #007399 100%);
    box-shadow: 0 6px 20px rgba(0, 153, 204, 0.4);
}

.google-button {
    background: linear-gradient(135deg, #34a853 0%, #137333 100%);
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.3);
}

.google-button:hover {
    background: linear-gradient(135deg, #137333 0%, #0f5132 100%);
    box-shadow: 0 6px 20px rgba(52, 168, 83, 0.4);
}

.navigation-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.smart-map-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.map-title {
    text-align: center;
    color: #171459;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.map-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.control-button.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.control-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.control-button.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.control-button.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.control-button.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.control-button.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(135deg, #e8ecff 0%, #f8f9ff 100%);
    border: 2px dashed #007bff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #171459;
    position: relative;
}

.loading {
    font-size: 1.2rem;
    font-weight: 600;
}

.map-content {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.shelter-marker {
    cursor: pointer; /* إكمال القاعدة المقطوعة */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* إصلاحات خاصة بالموبايل */
@media (max-width: 768px) {
    
    /* إصلاح أزرار الملاحة للموبايل */
    .navigation-buttons {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 140px !important;
        padding: 12px !important;
        background: rgba(248, 249, 250, 0.95) !important;
        border-radius: 10px !important;
        border: 1px solid #dee2e6 !important;
        margin: 5px 0 !important;
    }
    
    /* تحسين أزرار الملاحة */
    .map-button {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 120px !important;
        min-height: 40px !important;
        padding: 10px 12px !important;
        margin: 2px 0 !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        border: none !important;
        cursor: pointer !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
    }
    
    /* ألوان مميزة للأزرار في الموبايل */
    .map-button:nth-child(1) {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
        color: white !important;
    }
    
    .map-button.waze-button {
        background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%) !important;
        color: white !important;
    }
    
    .map-button.google-button {
        background: linear-gradient(135deg, #34a853 0%, #137333 100%) !important;
        color: white !important;
    }
    
    /* تأثيرات التفاعل للموبايل */
    .map-button:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    }
    
    /* إصلاح الجدول للموبايل */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
    }
    
    table {
        min-width: 100% !important;
        width: auto !important;
    }
    
    /* تحسين عرض الأعمدة */
    th, td {
        padding: 12px 8px !important;
        font-size: 14px !important;
        vertical-align: middle !important;
    }
    
    /* عمود الملاحة - تثبيته على اليمين */
    td:last-child, th:last-child {
        position: sticky !important;
        right: 0 !important;
        background: white !important;
        z-index: 10 !important;
        min-width: 140px !important;
        max-width: 140px !important;
        border-left: 2px solid #007bff !important;
        box-shadow: -2px 0 4px rgba(0,0,0,0.1) !important;
    }
    
    /* تحسين عرض اسم الملجأ */
    .shelter-name {
        font-size: 14px !important;
        line-height: 1.3 !important;
        max-width: 200px !important;
    }
    
    /* تحسين عرض الحي */
    .neighborhood {
        font-size: 12px !important;
        line-height: 1.3 !important;
        max-width: 150px !important;
    }
    
    /* تحسين الصور */
    .shelter-image {
        width: 60px !important;
        height: 45px !important;
        border-radius: 6px !important;
    }
    
    .shelter-image-placeholder {
        width: 60px !important;
        height: 45px !important;
        font-size: 10px !important;
    }
    
    /* إصلاح شريط الطوارئ */
    .emergency-bar {
        padding: 10px 15px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .emergency-button {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px 20px !important;
        min-height: 50px !important;
    }
    
    .emergency-info {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .digital-clock {
        font-size: 14px !important;
        padding: 6px 10px !important;
        min-width: 90px !important;
    }
    
    .share-location {
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-height: 36px !important;
    }
    
    /* تحسين الخريطة */
    #map {
        height: 350px !important;
        margin-bottom: 15px !important;
    }
    
    .map-controls {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .control-button {
        width: 100% !important;
        max-width: 280px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    /* تحسين معلومات الملجأ */
    .shelter-info {
        padding: 15px !important;
        margin-top: 10px !important;
        border-radius: 10px !important;
    }
    
    .shelter-info h4 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    .shelter-info p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 4px 0 !important;
    }
    
    /* تحسين معلومات المسافة */
    .distance-info {
        padding: 12px !important;
        margin-top: 8px !important;
        font-size: 14px !important;
    }
    
    .recalculate-btn {
        padding: 8px 15px !important;
        font-size: 12px !important;
        min-height: 32px !important;
    }
    
    /* تحسين جهات الاتصال الطارئة */
    .emergency-contact {
        padding: 20px !important;
        margin-top: 20px !important;
    }
    
    .emergency-contact h3 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    .emergency-contact .phone-number {
        font-size: 14px !important;
        padding: 8px 12px !important;
        margin: 6px 0 !important;
    }
}

/* إصلاحات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .navigation-buttons {
        min-height: 160px !important;
        padding: 15px 8px !important;
    }
    
    .map-button {
        max-width: 110px !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
        min-height: 36px !important;
    }
    
    td:last-child, th:last-child {
        min-width: 130px !important;
        max-width: 130px !important;
    }
    
    .shelter-image {
        width: 50px !important;
        height: 38px !important;
    }
    
    .container {
        padding: 5px !important;
    }
    
    .main-card {
        margin: 5px !important;
        border-radius: 15px !important;
    }
    
    .content {
        padding: 15px !important;
    }
}

/* إصلاحات إضافية للتأكد من ظهور الأزرار */
.navigation-buttons .map-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

/* إصلاح مشاكل التداخل */
tbody tr:hover .navigation-buttons {
    background: rgba(248, 249, 250, 1) !important;
    border: 1px solid #007bff !important;
}

/* التأكد من عمل events اللمس */
.map-button {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
}

/* إصلاح modal الصور للموبايل */
@media (max-width: 768px) {
    .image-modal-content {
        padding: 10px !important;
    }
    
    .image-modal img {
        max-width: 95% !important;
        max-height: 85% !important;
    }
    
    .image-modal-title {
        font-size: 16px !important;
        margin-top: 15px !important;
        padding: 0 10px !important;
    }
    
    .image-modal-close {
        top: 10px !important;
        right: 15px !important;
        font-size: 30px !important;
    }
}

/* أزرار الملاحة السريعة تحت الخريطة */
.distance-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.quick-navigation {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-nav-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.quick-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.quick-nav-btn.waze-nav {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
}

.quick-nav-btn.waze-nav:hover {
    background: linear-gradient(135deg, #0099cc 0%, #007399 100%);
}

.quick-nav-btn.google-nav {
    background: linear-gradient(135deg, #34a853 0%, #137333 100%);
}

.quick-nav-btn.google-nav:hover {
    background: linear-gradient(135deg, #137333 0%, #0f5132 100%);
}

.quick-nav-btn.map-nav {
    background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
}

.quick-nav-btn.map-nav:hover {
    background: linear-gradient(135deg, #5a2d91 0%, #4a2578 100%);
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .distance-actions {
        gap: 10px;
    }
    
    .quick-navigation {
        gap: 6px;
    }
    
    .quick-nav-btn {
        padding: 6px 10px;
        font-size: 10px;
        min-height: 28px;
    }
}

@media (max-width: 480px) {
    .quick-navigation {
        flex-direction: column;
        width: 100%;
    }
    
    .quick-nav-btn {
        width: 100%;
        max-width: 140px;
        margin: 0 auto;
    }
}
/* ===================== TOAST SYSTEM ===================== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 90%;
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: auto;
    direction: rtl;
}

.toast-show { opacity: 1; transform: translateY(0) scale(1); }
.toast-hide { opacity: 0; transform: translateY(-10px) scale(0.95); }

.toast-success { background: linear-gradient(135deg, #28a745, #20c997); }
.toast-error { background: linear-gradient(135deg, #dc3545, #c82333); }
.toast-info { background: linear-gradient(135deg, #007bff, #0056b3); }
.toast-warning { background: linear-gradient(135deg, #ff9800, #f57c00); }
.toast-emergency { background: linear-gradient(135deg, #dc3545, #8b0000); animation: emergencyToast 0.5s ease; }

@keyframes emergencyToast {
    0%, 50%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(0) scale(1.03); }
    75% { transform: translateY(0) scale(1.03); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

/* ===================== EMERGENCY BUTTON IMPROVEMENTS ===================== */
.emergency-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    animation: emergencyPulse 2s infinite;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(255, 107, 107, 0.3);
    touch-action: manipulation;
}

.emergency-pulse {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.15); opacity: 0; }
}

@keyframes emergencyPulse {
    0% { box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(255, 107, 107, 0.8); }
    100% { box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4); }
}

.emergency-button:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.6);
}

.emergency-button.loading-btn {
    animation: none;
    opacity: 0.8;
    pointer-events: none;
}

/* ===================== MOBILE CARDS ===================== */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.shelter-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    touch-action: manipulation;
}

.shelter-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.card-main {
    display: flex;
    gap: 12px;
    padding: 14px;
}

.card-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e0e6ff;
}

.card-text {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-weight: 700;
    font-size: 15px;
    color: #171459;
    margin-bottom: 4px;
    line-height: 1.3;
}

.card-neighborhood {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

.card-capacity {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.card-distance {
    margin-top: 4px;
}

.dist-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    border-top: 1px solid #f0f0f0;
    background: #fafbff;
}

.card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 11px 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
}

.card-btn:not(:last-child) {
    border-left: 1px solid #f0f0f0;
}

.card-btn.waze-btn { color: #0099cc; }
.card-btn.google-btn { color: #137333; }
.card-btn.map-btn { color: #171459; }

.card-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Migonit card accent */
.migonit-card {
    border-right: 4px solid #ff8c00;
}

/* ===================== SPINNER ===================== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(23, 20, 89, 0.2);
    border-top-color: #171459;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #171459;
}

/* ===================== SHELTER INFO IMPROVEMENTS ===================== */
.shelter-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.close-info-btn {
    background: rgba(0, 0, 0, 0.08);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-info-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

.distance-flash {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    color: #155724 !important;
    transition: all 0.3s ease;
}

/* ===================== PHONE GRID ===================== */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (max-width: 480px) {
    .phone-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== MIGONIYOT SECTION ===================== */
.migoniyot-section { margin-bottom: 30px; }

.migoniyot-header {
    background: linear-gradient(135deg, #ff8c00 0%, #e67e00 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px 15px 0 0;
    text-align: center;
}

.migoniyot-header h2 { margin: 0; font-size: 1.5rem; font-weight: 700; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.migoniyot-subtitle { margin: 8px 0 0 0; font-size: 0.95rem; opacity: 0.9; }

.migoniyot-table { border-radius: 0 0 15px 15px !important; border-top: none !important; }
.migoniyot-table thead { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); }
.migoniyot-table th { color: #e65100; }
.migoniyot-table tbody tr:hover { background: linear-gradient(135deg, #fff8f0 0%, #fff 100%); }

.migonit-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ff8c00 0%, #e67e00 100%);
    color: white; font-weight: 700; font-size: 1.1rem;
    width: 36px; height: 36px; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.migonit-map-btn { background: linear-gradient(135deg, #ff8c00 0%, #e67e00 100%) !important; box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3) !important; }
.migonit-map-btn:hover { background: linear-gradient(135deg, #e67e00 0%, #cc6d00 100%) !important; }

/* ===================== MAP LEGEND ===================== */
.map-legend {
    display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; flex-wrap: wrap;
}

.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; color: #333; }

.legend-dot { display: inline-block; width: 14px; height: 14px; border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.legend-dot.shelter-dot { background: #dc3545; border-radius: 50%; }
.legend-dot.migonit-dot { background: #ff8c00; border-radius: 3px; }

/* ===================== CONTROL BUTTONS ===================== */
.waze-ctrl { background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%) !important; color: white !important; }
.location-ctrl { background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%) !important; color: white !important; }

/* ===================== GLOBAL TOUCH IMPROVEMENTS ===================== */
button, a, .shelter-card, .map-button, .control-button, .card-btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    touch-action: manipulation;
}

/* ===================== MOBILE OVERRIDES ===================== */
@media (max-width: 768px) {
    .toast-container { top: 70px; width: 94%; }
    .toast { font-size: 13px; padding: 10px 14px; }

    .emergency-button { font-size: 17px; padding: 14px 24px; width: 100%; }
    
    .map-controls {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
    }

    .control-button {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 13px !important;
        padding: 10px 12px !important;
    }
    
    #map { height: 350px !important; }

    .shelter-info { padding: 14px !important; }
    .shelter-info h4 { font-size: 15px !important; }
    .shelter-info p { font-size: 13px !important; }
    
    .migoniyot-header { padding: 15px 18px; }
    .migoniyot-header h2 { font-size: 1.15rem; }
    .migoniyot-subtitle { font-size: 0.85rem; }

    .map-legend { gap: 12px; }
    .legend-item { font-size: 0.82rem; }

    .emergency-contact { padding: 18px !important; }
    .emergency-contact h3 { font-size: 15px !important; }
    .phone-number { font-size: 14px !important; padding: 10px 12px !important; }
}

@media (max-width: 480px) {
    .container { padding: 6px !important; }
    .content { padding: 14px !important; }
    .card-name { font-size: 14px; }
    .card-image { width: 60px; height: 60px; }
    .map-controls { grid-template-columns: 1fr 1fr; gap: 6px !important; }
    .control-button { font-size: 12px !important; min-height: 40px !important; }
    .map-legend { flex-direction: column; align-items: center; gap: 6px; }
}