:root {
    --primary-color: #2c3e50;
    --accent-color: #e74c3c;
    --call-color: #27ae60;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Cairo', sans-serif; background-color: var(--bg-color); color: #333; line-height: 1.6; padding-bottom: 80px; }

/* Header */
header { background: linear-gradient(135deg, #1a2a6c, #b21f1f); color: white; text-align: center; padding: 2rem 1rem 3rem; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; }
header h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }

/* Search */
.search-container { margin: -25px auto 30px; width: 90%; max-width: 600px; position: relative; z-index: 10; }
#searchInput { width: 100%; padding: 15px 20px; border-radius: 50px; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-family: 'Cairo', sans-serif; font-size: 1rem; outline: none; text-align: right; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.section-title { margin: 30px 0 15px; font-size: 1.3rem; color: var(--primary-color); border-right: 5px solid var(--accent-color); padding-right: 10px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }

/* Cards */
button:active, .card:active, .call-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}
.card { background: var(--card-bg); border-radius: 12px; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s; }
.card:hover { transform: translateY(-2px); }
.name { font-weight: 700; font-size: 1.1rem; color: #2c3e50; }
.number-display { font-family: sans-serif; color: #7f8c8d; font-size: 0.95rem; direction: ltr; text-align: right; margin-top: 5px; }
.call-btn { background-color: var(--call-color); color: white; text-decoration: none; padding: 10px 20px; border-radius: 50px; font-weight: 600; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; white-space: nowrap; }

/* Map */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.map-container { margin-top: 20px; background: white; padding: 10px; border-radius: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; }
.map-frame { width: 100%; height: 450px; border-radius: 10px; z-index: 1; }
.map-note { font-size: 0.8rem; text-align: center; margin-top: 5px; color: #777; }

/* Map Legend */
.custom-legend { background: rgba(255, 255, 255, 0.9); padding: 12px; border-radius: 14px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); width: 180px; max-height: 50vh; display: flex; flex-direction: column; font-family: 'Cairo', sans-serif; }
.legend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: bold; }
#toggleLegendBtn { border: none; background: transparent; font-size: 18px; cursor: pointer; padding: 0 5px; }
.legend-list { overflow-y: auto; flex-grow: 1; margin-bottom: 10px; }
.legend-item { padding: 6px 8px; font-size: 0.85rem; cursor: pointer; border-radius: 6px; margin-bottom: 4px; transition: background 0.2s; }
.legend-item:hover { background: #f0f2f5; }
.legend-item.active { background: #2c3e50; color: white; }
.legend-actions { display: flex; flex-direction: column; gap: 5px; }
.legend-action-btn { width: 100%; padding: 8px; border: none; background: #2c3e50; color: white; border-radius: 8px; cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 0.85rem; }
.legend-action-btn:hover { background: #34495e; }

/* Legend Collapsed State */
.custom-legend.legend-collapsed { width: auto; height: auto; }
.custom-legend.legend-collapsed .legend-list,
.custom-legend.legend-collapsed .legend-actions { display: none; }

/* Form */
.feedback-form { background: white; padding: 20px; border-radius: 12px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-family: 'Cairo', sans-serif; }
.submit-btn { background: var(--primary-color); color: white; border: none; padding: 10px 25px; border-radius: 5px; cursor: pointer; font-family: 'Cairo', sans-serif; }

/* PWA Banner */
#installBanner { display: none; background: #333; color: white; padding: 15px; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; z-index: 2000; box-shadow: 0 -2px 10px rgba(0,0,0,0.2); flex-wrap: wrap; justify-content: center; gap: 10px; align-items: center; }
#installBanner.visible { display: flex; }
#installBanner button { background: var(--accent-color); border: none; padding: 5px 15px; color: white; border-radius: 5px; cursor: pointer; margin: 0 5px; }
#installBanner .btn-outline { background: transparent; border: 1px solid #777; }

/* Floating Share */
.share-float { position: fixed; bottom: 20px; left: 20px; background: #25D366; color: white; width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; text-decoration: none; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.2s; }
.share-float:hover { transform: scale(1.1); }
footer { text-align: center; padding: 30px; color: #7f8c8d; font-size: 0.8rem; margin-top: 40px; border-top: 1px solid #eee; }
.credits i { color: #e74c3c; }
.credits a { color: #2c3e50; text-decoration: underline; font-weight: 700; }
