/* ============================================================================
 * Egypt Web GIS Platform - Full Arabic RTL Styling (CSS3)
 * Glassmorphic, Modern, Responsive Design (Desktop & Mobile First)
 * ============================================================================ */

:root {
  --font-arabic: 'Tajawal', 'Cairo', sans-serif;
  --bg-main: #090d16;
  --bg-panel: rgba(15, 23, 42, 0.92);
  --bg-card: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --emerald-main: #10b981;
  --amber-main: #f59e0b;
  --sky-main: #0284c7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  font-family: var(--font-arabic);
  direction: rtl;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Navbar */
.app-header {
  height: 4rem;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  position: sticky;
  top: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 2.75rem;
  width: auto;
  max-width: 3.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-title-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}

.brand-title-main {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-title-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(2, 6, 23, 0.6);
  padding: 0.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-tab {
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #f8fafc;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background-color: var(--emerald-main);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Main Layout Area */
.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-container {
  width: 100%;
  height: calc(100vh - 4rem);
  background-color: #0f172a;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
}

/* Floating Toolbars */
.map-toolbar-right {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-tool {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background-color: rgba(30, 41, 59, 0.9);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-tool:hover {
  background-color: #334155;
  transform: scale(1.05);
}

.btn-tool.active {
  background-color: var(--emerald-main);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* Coordinates & Scale Footer Bar */
.map-footer-bar {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  right: 1rem;
  z-index: 40;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.coord-highlight {
  color: var(--emerald-main);
  font-family: monospace;
  font-weight: 700;
}

/* Mobile Bottom Sheet */
.mobile-bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

.mobile-bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 3rem;
  height: 0.3rem;
  background-color: #475569;
  border-radius: 9999px;
  margin: 0 auto 0.75rem auto;
}

/* Responsive Rules for Mobile (<768px) */
@media (max-width: 768px) {
  .app-header {
    padding: 0 0.75rem;
  }

  .brand-logo-img {
    height: 2.2rem;
    max-width: 2.8rem;
  }

  .brand-title-main {
    font-size: 0.82rem;
  }

  .brand-title-sub {
    font-size: 0.68rem;
  }

  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-around;
    padding: 0.5rem 0.25rem;
    background-color: #090d16;
  }

  .nav-tab {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    flex-direction: column;
    gap: 0.1rem;
  }

  .map-container {
    height: calc(100vh - 7.5rem);
  }

  .map-footer-bar {
    bottom: 3.8rem;
    font-size: 0.65rem;
    padding: 0.4rem 0.6rem;
  }

  .map-toolbar-right {
    top: 0.75rem;
    right: 0.75rem;
  }

  .btn-tool {
    width: 2.5rem;
    height: 2.5rem;
  }
}
