/* GalaxyNetwork Suite Web - Dark Sci-Fi Theme */
:root {
  --bg-dark: #0B0E14;
  --bg-panel: #111620;
  --bg-card: #161D2A;
  --bg-input: #0D121B;
  --border: #212B3B;
  --border-focus: #38BDF8;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --primary: #38BDF8;
  --primary-hover: #0EA5E9;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --purple: #A78BFA;
  --card-radius: 8px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Navbar */
.navbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-brand span.badge {
  font-size: 0.7rem;
  background: #0369A1;
  color: #E0F2FE;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.user-role-badge {
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: bold;
}
.role-admin { background: #7F1D1D; color: #FECACA; }
.role-standard { background: #064E3B; color: #A7F3D0; }

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #0F172A;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-accent {
  background: var(--accent);
  color: #0F172A;
}
.btn-accent:hover {
  background: #D97706;
}

.btn-success {
  background: var(--success);
  color: #0F172A;
}
.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  background: #DC2626;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

/* Container & Grid */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Cards & Panels */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table tr.highlight td {
  background: rgba(56, 189, 248, 0.08);
}

/* Status Badges */
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-friendly { background: #064E3B; color: #A7F3D0; }
.tag-hostile { background: #7F1D1D; color: #FECACA; }
.tag-farm { background: #78350F; color: #FDE68A; }
.tag-bunker { background: #581C87; color: #E9D5FF; }

/* Progress / Accuracy bar */
.progress-bar-container {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 24px;
  overflow: hidden;
  position: relative;
  margin: 0.75rem 0;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.progress-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-main);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.2s ease-out;
}
.toast-success { border-color: var(--success); color: #A7F3D0; }
.toast-error { border-color: var(--danger); color: #FECACA; }
.toast-info { border-color: var(--primary); color: #BAE6FD; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Login Page Specific */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-title {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
}

/* RTL Support for Sorani Kurdish */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .navbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] @keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

[dir="rtl"] .form-row {
  flex-direction: row-reverse;
}

/* Partner and Archetype Badges */
.badge-partner {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.archetype-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.archetype-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.archetype-card.active {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Language Flag Switcher */
.flag-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.flag-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.flag-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.flag-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

/* Combat Fleet Cards */
.combat-fleet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.combat-fleet-card.type-target {
  border-left: 4px solid var(--danger);
}

.combat-fleet-card.type-defender {
  border-left: 4px solid var(--success);
}

.combat-fleet-card.type-attacker {
  border-left: 4px solid var(--primary);
}

/* Combat Unit Grid */
.combat-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.combat-unit-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
}

.combat-unit-box label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combat-unit-box input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.2rem 0.35rem;
  font-weight: 600;
}

/* Scout Partner Chips */
.scout-partner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 16px;
  font-size: 0.8rem;
}


