/* ========================================
   🎨 استایل بهینه‌شده - منظم و فشرده
   ======================================== */

/* متغیرهای CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success-color: #10b981;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom Sheet Container */
.location-bottom-sheet {
    position: fixed;
    bottom: -120%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    height: 95vh;
    max-height: 850px;
    z-index: 10000;
    transition: bottom 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.location-bottom-sheet.open {
    bottom: 0;
}

/* Header - فشرده */
.sheet-header {
    padding: 8px 16px 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: 10px;
    margin: 0 auto 8px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), #bfdbfe);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.close-sheet-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.close-sheet-btn:active {
    transform: scale(0.9);
}

/* Map Section - واید کامل، بدون padding */
.map-section {
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.urgentmap-container2 {
    position: relative;
    width: 100%;
    background: var(--bg-primary);
    touch-action: none;
}

#map {
    width: 100%;
    height: 40vh;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#map * {
    touch-action: inherit;
}

.map2h{

    height: 40vh !important;
}

.map-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
    z-index: 2;
}

.urgentmap-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    font-size: 11px;
    color: #92400e;
    font-weight: 500;
}

.urgentmap-hint svg {
    flex-shrink: 0;
}

/* Content - فقط نتایج جستجو */
.sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px;
    background: var(--bg-secondary);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Footer - فشرده و منظم */
.sheet-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Search Box - فشرده */
.location-search-box {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
}

.location-search-box:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.location-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: none;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
}

.location-search-box input:focus {
    outline: none;
}

.location-search-box input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-btn:active {
    transform: scale(0.95);
}

/* Address Selector - فشرده */
.address-selector {
    display: flex;
    gap: 8px;
}

.select-wrapper {
    flex: 1;
    position: relative;
}

.address-selector select {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: inherit;
}

.address-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.select-arrow {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.save-address-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

.save-address-btn:active {
    transform: scale(0.95);
}

/* Current Location - فشرده */
.current-location-info {
    background: linear-gradient(135deg, var(--primary-light), #eff6ff);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
}

.location-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    color: var(--primary-dark);
}

.location-label small {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.current-address-text {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2px;
}

.current-coords-text {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: left;
}

/* Footer Buttons */
.footer-buttons {
    display: flex;
    gap: 8px;
}

.urgentbtn-map {
    flex: 1;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    font-family: inherit;
}

.urgentbtn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.urgentbtn-cancel:active {
    background: var(--border-color);
}

.urgentbtn-confirm {
    flex: 2;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: var(--shadow-sm);
}

.urgentbtn-confirm:active {
    transform: scale(0.98);
}

/* Search Results */
.search-results {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    display: none;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results div {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.search-results div:last-child {
    border-bottom: none;
}

.search-results div:active {
    background: var(--primary-light);
}

.search-results div::before {
    content: '📍';
    font-size: 14px;
}

/* ========================================
   📱 ریسپانسیو
   ======================================== */
@media (max-width: 480px) {
    .location-bottom-sheet {
        height: 98vh;
    }
    
    #map {
        height: 160px;
    }
    
    
    .header-text h3 {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    .location-bottom-sheet {
        max-width: 550px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg);
        height: 85vh;
    }
    
    .location-bottom-sheet.open {
        bottom: 20px;
    }
    
    #map {
        height: 220px;
    }
}

/* اسکرول‌بار */
.sheet-content::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 5px;
}

.sheet-content::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}


.btn-my-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 1px;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #ce0e67;
    border: 1px solid #f1f5f1;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-my-location:hover {
    background: #c8e6c9;
}

.btn-my-location:active {
    transform: scale(0.97);
}

.btn-my-location i {
    font-size: 14px;
}


