/**
 * gleason.css
 * -----------------------------------------------------------------------------
 * الأنماط الأساسية لتطبيق خريطة غليسون.
 * - الخريطة تأخذ الشاشة كاملة (100vh) — لا توجد قائمة علوية بعد الآن.
 * - أنماط الشريط الجانبي في ملف sidebar.css.
 * -----------------------------------------------------------------------------
 */

html,
body {
  height: 100%;
  margin: 0;
  background: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans Arabic", Tahoma, sans-serif;
}

/* ─── حاوية الخريطة (Full Screen) ──────────────────────────────────── */
#map {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#map .ol-viewport {
  position: relative !important;
}

/* ─── أدوات التدوير (تبقى عائمة) ──────────────────────────────────── */
.rotation-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  min-width: 200px;
}

.rotation-controls h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #2c3e50;
  font-weight: 600;
}

.rotation-slider-container {
  margin-bottom: 12px;
}

.rotation-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.rotation-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: grab;
  border: 3px solid #3b82f6;
}

.rotation-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.rotation-value {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #3b82f6;
  margin: 6px 0;
  font-family: "Courier New", monospace;
}

.rotation-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.rotation-btn {
  padding: 7px 10px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.rotation-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.rotation-btn:active {
  transform: translateY(0);
}

.rotation-btn.reset {
  background: #ef4444;
  grid-column: 1 / -1;
}

.rotation-btn.reset:hover {
  background: #dc2626;
}

.rotation-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.preset-btn {
  padding: 5px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  transition: all 0.2s;
  color: #374151;
  font-weight: 500;
}

.preset-btn:hover {
  background: #e5e7eb;
  border-color: #3b82f6;
  color: #3b82f6;
}

/* ─── البوصلة (تبقى عائمة) ────────────────────────────────────────── */
.compass {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  cursor: pointer;
  border: 3px solid #3b82f6;
}

.compass-arrow {
  font-size: 34px;
  color: #ef4444;
  transition: transform 0.3s ease;
}

.compass:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ─── حركة الدوران ─────────────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  animation: spin 10s linear infinite;
}

/* ─── تحسينات على الـ Canvas ───────────────────────────────────────── */
.ol-layer canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.ol-viewport {
  font-family: "Segoe UI", Tahoma, "Arial", sans-serif;
}

/* ─── مؤشر التحميل ─────────────────────────────────────────────────── */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 3000;
}

.loading-indicator.active {
  display: block;
}

/* ─── إخفاء أدوات OpenLayers الافتراضية إذا لزم ───────────────────── */
.ol-attribution {
  font-size: 11px;
}

/* ─── استجابة للموبايل ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .rotation-controls {
    top: 12px;
    left: 12px;
    padding: 10px;
    min-width: 180px;
  }

  .compass {
    bottom: 12px;
    left: 12px;
    width: 60px;
    height: 60px;
  }

  .compass-arrow {
    font-size: 28px;
  }
}
