/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --live-green: #10b981;
  --live-pulse: #34d399;
  --bg: #0f0a1a;
  --bg-card: #1a1128;
  --bg-sidebar: #150e24;
  --bg-modal: #1e1533;
  --text: #f1f0f5;
  --text-muted: #9ca3af;
  --border: #2d2440;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* === Header === */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  z-index: 1000;
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 32px;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.logo h1 {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* === Buttons === */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5);
}

.btn-lang {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lang:hover { color: var(--text); border-color: var(--primary-light); }

.btn-icon { font-size: 18px; font-weight: 700; }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }

/* === Main Layout === */
.main-layout {
  display: flex;
  height: calc(100vh - 64px);
}

/* === Sidebar === */
.sidebar {
  width: 380px;
  min-width: 380px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 500;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab.active {
  background: var(--primary);
  color: white;
}

.tab:hover:not(.active) { color: var(--text); }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live-green);
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-filters select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
}

.sidebar-filters select option { background: var(--bg-card); }

/* === Event List === */
.event-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-list::-webkit-scrollbar { width: 6px; }
.event-list::-webkit-scrollbar-track { background: transparent; }
.event-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.event-card:hover {
  border-color: var(--primary-light);
  transform: translateX(-2px);
  box-shadow: var(--shadow);
}

.event-card.live {
  border-color: var(--live-green);
  border-width: 2px;
}

.event-card.live::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: var(--live-green);
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.event-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.event-card-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: var(--live-green);
}

.badge-upcoming {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

.event-card-category {
  font-size: 20px;
  margin-bottom: 8px;
}

.event-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.event-card-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-card-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-organizer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.loading, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* === Map === */
.map-container {
  flex: 1;
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
  background: var(--bg);
}

/* Leaflet dark theme overrides */
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip { background: var(--bg-card) !important; }

.leaflet-popup-content {
  margin: 12px 16px !important;
  font-family: 'Heebo', sans-serif !important;
  direction: rtl;
}

.popup-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.popup-category { font-size: 14px; margin-bottom: 4px; }
.popup-time { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.popup-address { font-size: 12px; color: var(--text-muted); }
.popup-desc { font-size: 13px; margin-top: 6px; line-height: 1.4; }

/* Live marker animation */
.marker-live {
  animation: markerPulse 2s ease infinite;
}

@keyframes markerPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

form { padding: 24px; }

.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-group select option { background: var(--bg-card); }

.form-group textarea { resize: vertical; }

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; }

/* Address autocomplete */
.address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 100;
  display: none;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.address-suggestions.open { display: block; }

.address-suggestion {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.address-suggestion:last-child { border-bottom: none; }
.address-suggestion:hover { background: rgba(124, 58, 237, 0.1); }

/* === Mobile Toggle === */
.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
  z-index: 600;
  align-items: center;
  justify-content: center;
}

/* === Responsive === */
@media (max-width: 768px) {
  .header { padding: 0 12px; height: 56px; }
  .logo h1 { font-size: 18px; }
  .logo-subtitle { display: none; }

  .sidebar {
    position: fixed;
    top: 56px;
    right: -100%;
    width: 100%;
    min-width: auto;
    height: calc(100vh - 56px);
    transition: right 0.3s ease;
    z-index: 500;
  }

  .sidebar.open { right: 0; }

  .mobile-toggle { display: flex; }

  .modal { max-width: 100%; margin: 10px; }
  .form-row { flex-direction: column; gap: 0; }

  .btn-primary .btn-icon { display: none; }
  .btn-primary span[data-i18n] { font-size: 12px; }
}

/* Category colors for markers */
.category-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
