@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700&display=swap");

:root {
  --galaxy-bg: #080b16;
  --galaxy-ink: #e8f0ff;
  --galaxy-muted: rgba(232, 240, 255, 0.65);
  --galaxy-glass: rgba(16, 24, 42, 0.6);
  --galaxy-glass-strong: rgba(20, 31, 55, 0.82);
  --galaxy-border: rgba(120, 190, 255, 0.2);
  --galaxy-accent: #3dd9c1;
  --galaxy-accent-2: #ffb86b;
  --galaxy-danger: #ff6b6b;
  --galaxy-success: #43f3a5;
  --galaxy-shadow: 0 24px 64px rgba(5, 10, 24, 0.65);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --glow: 0 0 40px rgba(61, 217, 193, 0.2);
  --primary-font-family: "Space Grotesk";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Space Grotesk", "Tajawal", sans-serif;
  color: var(--galaxy-ink);
  background: var(--galaxy-bg);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body.rtl {
  font-family: "Tajawal", "Space Grotesk", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 15% 20%, rgba(61, 217, 193, 0.25), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 184, 107, 0.2), transparent 35%),
    radial-gradient(circle at 70% 80%, rgba(120, 90, 255, 0.18), transparent 45%),
    linear-gradient(180deg, #060913 0%, #0b1226 50%, #070b18 100%);
}

body::after {
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.6) 40%, transparent 60%),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.4) 40%, transparent 60%),
    radial-gradient(1px 1px at 90px 140px, rgba(255, 255, 255, 0.5) 40%, transparent 60%),
    radial-gradient(2px 2px at 200px 200px, rgba(255, 255, 255, 0.4) 40%, transparent 60%);
  background-size: 240px 240px;
  opacity: 0.45;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: var(--galaxy-glass-strong);
  border-right: 1px solid var(--galaxy-border);
  backdrop-filter: blur(18px);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.close-sidebar-btn {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--galaxy-border);
  background: rgba(255, 255, 255, 0.06);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-sidebar.sidebar-inact {
  transform: translateX(-110%);
  width: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}

.app-sidebar.open {
  transform: translateX(0);
  width: 260px;
  padding: 28px 20px;
  border-right: 1px solid var(--galaxy-border);
}

.sidebar-header {
  margin-bottom: 28px;
}

.app-logo img {
  max-width: 160px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--galaxy-muted);
  background: transparent;
  transition: all 0.2s ease;
}

html[dir="rtl"] .sidebar-menu li a {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .profile-hero-header {
  flex-direction: row-reverse;
}

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

.sidebar-menu li.active a,
.sidebar-menu li a:hover {
  color: var(--galaxy-ink);
  background: rgba(61, 217, 193, 0.12);
  box-shadow: var(--glow);
}

.menu-icon {
  font-size: 18px;
}

.app-header {
  padding: 20px 26px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(18px);
  background: rgba(6, 9, 19, 0.7);
  border-bottom: 1px solid var(--galaxy-border);
}

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

.header-dropdown {
  position: relative;
}

.header-btn {
  border: 1px solid var(--galaxy-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--galaxy-ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.header-btn:hover {
  background: rgba(61, 217, 193, 0.16);
  border-color: rgba(61, 217, 193, 0.6);
}

.header-btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.notify-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--galaxy-danger);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 6px;
}

.dropdown-content {
  position: absolute;
  right: 0;
  top: 54px;
  min-width: 240px;
  background: var(--galaxy-glass-strong);
  border: 1px solid var(--galaxy-border);
  border-radius: 14px;
  padding: 12px;
  display: none;
  box-shadow: var(--galaxy-shadow);
  z-index: 50;
}

html[dir="rtl"] .dropdown-content {
  right: auto;
  left: 0;
  text-align: right;
}

.dropdown-content a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--galaxy-ink);
}

.dropdown-content a:hover {
  background: rgba(61, 217, 193, 0.12);
}

.dropdown-content.show {
  display: block;
}

.g-select-wrap {
  position: relative;
  z-index: 20;
}

.g-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.g-select-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--galaxy-ink);
  border-bottom: 2px solid var(--galaxy-ink);
  transform: rotate(45deg);
  margin-left: 10px;
  opacity: 0.8;
}

html[dir="rtl"] .g-select-trigger::after {
  margin-left: 0;
  margin-right: 10px;
}

.g-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(6, 9, 19, 0.95);
  border: 1px solid rgba(120, 190, 255, 0.25);
  box-shadow: var(--galaxy-shadow);
  border-radius: 12px;
  padding: 6px;
  z-index: 200;
}

.g-select-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--galaxy-ink);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

html[dir="rtl"] .g-select-item {
  text-align: right;
}

.g-select-item:hover,
.g-select-item.active {
  background: rgba(61, 217, 193, 0.12);
}

.dropdown-menu {
  background: var(--galaxy-glass-strong);
  border: 1px solid var(--galaxy-border);
  border-radius: 12px;
  box-shadow: var(--galaxy-shadow);
  padding: 8px;
}

.dropdown-item {
  color: var(--galaxy-ink);
  border-radius: 10px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(61, 217, 193, 0.12);
  color: var(--galaxy-ink);
}

.dropdown-menu.filter-items {
  max-height: 50vh;
  overflow-y: auto;
}

.notify-dropdown {
  width: 360px;
}

.dropdown-header,
.dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  padding-top: 8px;
  margin-top: 8px;
}

.dropdown-link {
  color: var(--galaxy-accent);
  font-size: 13px;
}

.dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}

@media (max-width: 768px) {
  .dropdown-content {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    min-width: 0;
    width: auto;
    max-width: calc(100vw - 24px);
  }

  html[dir="rtl"] .dropdown-content {
    left: 12px;
    right: 12px;
  }

  .notify-dropdown {
    width: auto;
    max-height: 60vh;
    overflow-y: auto;
  }

  .g-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    max-width: 100%;
  }
}

.notify-item {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 8px;
  color: var(--galaxy-ink);
  transition: all 0.2s ease;
}

.notify-item:hover {
  background: rgba(61, 217, 193, 0.15);
}

.notify-item.unread {
  border: 1px solid rgba(61, 217, 193, 0.4);
  box-shadow: var(--glow);
}

.notify-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.notify-text {
  color: var(--galaxy-muted);
  font-size: 13px;
}

.notify-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-top: 6px;
}

.badge {
  background: rgba(61, 217, 193, 0.2);
  color: var(--galaxy-ink);
  border: 1px solid rgba(61, 217, 193, 0.5);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.notify-empty {
  color: var(--galaxy-muted);
  text-align: center;
  padding: 20px 0;
}

.app-content {
  flex: 1;
  padding: 32px 24px 48px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--galaxy-muted);
}

.g-card {
  background: var(--galaxy-glass);
  border: 1px solid var(--galaxy-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--galaxy-shadow);
  backdrop-filter: blur(18px);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.g-card-body {
  padding: 24px;
  overflow: visible;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.profile-hero-header {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(61, 217, 193, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 20px;
  font-weight: 600;
}

.profile-handle,
.profile-meta {
  color: var(--galaxy-muted);
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
  border-radius: var(--radius-md);
}

.stat-label {
  color: var(--galaxy-muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

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

.form-control {
  width: 100%;
  background: rgba(8, 12, 24, 0.75);
  border: 1px solid rgba(120, 190, 255, 0.25);
  color: var(--galaxy-ink);
  border-radius: 12px;
  padding: 10px 12px;
}

.form-control select,
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--galaxy-ink) 50%),
    linear-gradient(135deg, var(--galaxy-ink) 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    calc(100% - 36px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 18px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

html[dir="rtl"] select.form-control {
  background-position:
    18px calc(50% - 2px),
    12px calc(50% - 2px),
    36px 50%;
  padding-left: 42px;
  padding-right: 12px;
}

select.form-control option {
  background: #0b1226;
  color: var(--galaxy-ink);
}

.form-control:focus {
  outline: none;
  border-color: rgba(61, 217, 193, 0.8);
  box-shadow: var(--glow);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--galaxy-accent), #2f9bd8);
  color: #05080f;
}

.btn-warning {
  background: linear-gradient(135deg, var(--galaxy-accent-2), #ff8f5d);
  color: #05080f;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--galaxy-ink);
  border: 1px solid var(--galaxy-border);
}

.alert {
  border-radius: 12px;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(255, 107, 107, 0.16);
  border-color: rgba(255, 107, 107, 0.6);
  color: #ffd6d6;
}

.alert-success {
  background: rgba(67, 243, 165, 0.14);
  border-color: rgba(67, 243, 165, 0.5);
  color: #d8ffef;
}

.table {
  color: var(--galaxy-ink);
}

.table > thead > tr > th {
  border-bottom: 1px solid var(--galaxy-border);
}

.table > tbody > tr > td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.notify-list .notify-item.large {
  padding: 16px;
}

@media (max-width: 992px) {
  .app-container {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    left: -280px;
    transition: left 0.2s ease;
    z-index: 20;
    max-width: 82vw;
  }

  .app-sidebar.open {
    left: 0;
    max-width: 82vw;
  }

  html[dir="rtl"] .app-sidebar {
    left: auto;
    right: -280px;
    transition: right 0.2s ease;
  }

  html[dir="rtl"] .app-sidebar.open {
    left: auto;
    right: 0;
  }

  html[dir="rtl"] .app-sidebar.sidebar-inact {
    transform: translateX(110%);
  }

  .close-sidebar-btn {
    display: flex;
  }

  .app-content {
    padding: 20px 16px 40px;
  }

  .app-header {
    padding: 16px 14px;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .navbar-collapse {
    background: rgba(16, 24, 42, 0.9);
    border: 1px solid var(--galaxy-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 12px;
  }

  .navbar-toggler {
    z-index: 6;
  }

  html[dir="rtl"] .navbar-nav {
    text-align: right;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .notify-dropdown {
    width: 300px;
    right: -40px;
  }

  .app-header {
    padding: 16px 14px;
  }

  .app-content {
    padding: 18px 14px 32px;
  }

  .g-card-body {
    padding: 18px;
  }

  .heading {
    padding: 24px 0 48px;
  }

  .navbar-brand img {
    height: 48px;
  }

  .hero-img {
    max-height: 320px;
    margin-bottom: 0;
  }

  .img-side {
    position: static;
    max-width: 100%;
    height: auto;
    margin-top: 16px;
  }

  .payment-safe {
    margin-top: 20px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table.services thead,
  .table.rwd-table thead {
    display: none;
  }

  .table.services tbody tr,
  .table.rwd-table tbody tr {
    display: block;
    background: rgba(16, 24, 42, 0.6);
    border: 1px solid var(--galaxy-border);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .table.services td,
  .table.rwd-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    word-break: break-word;
  }

  .table.services td:first-child,
  .table.rwd-table td:first-child {
    border-top: none;
  }

  .table.services td::before,
  .table.rwd-table td::before {
    content: attr(data-title);
    color: var(--galaxy-muted);
    font-size: 12px;
    flex: 0 0 42%;
  }

  .table.services tr.service-category td {
    display: block;
    padding: 6px 0;
    border-top: none;
    font-weight: 600;
    color: var(--galaxy-ink);
  }

  .table.services tr.service-category td::before {
    content: none;
  }
}

.api pre {
  background: rgba(16, 24, 42, 0.6);
  border: 1px solid var(--galaxy-border);
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
}

.api .table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

.heading {
  padding: 40px 0 80px;
  position: relative;
}

.navbar {
  background: transparent;
}

.navbar-brand {
  font-weight: 600;
  color: var(--galaxy-ink);
}

.navbar .nav-link {
  color: var(--galaxy-muted);
}

.navbar .nav-item.active .nav-link,
.navbar .nav-link:hover {
  color: var(--galaxy-ink);
}

.secure-payment,
.feature {
  background: rgba(16, 24, 42, 0.7);
  border: 1px solid var(--galaxy-border);
  border-radius: var(--radius-md);
}
