/* reset بسيط */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* متغيرات عامة  الوضع الافتراضي دارك */

:root {
  color-scheme: dark;

  --bg-page: #020617;
  --bg-header: rgba(2, 6, 23, 0.95);
  --bg-sidebar: rgba(2, 6, 23, 0.98);

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;

  --accent: #f97316;
  --accent-strong: #ea580c;

  --border-subtle: rgba(148, 163, 184, 0.25);

  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

/* ثيم فاتح عند اختيار data-theme="light" على html */

html[data-theme="light"] {
  color-scheme: light;

  --bg-page: #f3f4f6;
  --bg-header: rgba(249, 250, 251, 0.95);
  --bg-sidebar: #f9fafb;

  --text-main: #0f172a;
  --text-muted: #6b7280;

  --border-subtle: rgba(148, 163, 184, 0.45);
}

/* جسم الصفحة */

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.16), transparent 55%),
    linear-gradient(135deg, var(--bg-page), var(--bg-page));
  color: var(--text-main);
  direction: rtl;
  text-align: right;
}

html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

.site-logo img {
  height: 40px;
  width: auto;
}


html[dir="ltr"] .page-header,
html[dir="ltr"] .page-title-group,
html[dir="ltr"] .card {
  text-align: left;
}


/* حاوية التطبيق الاساسية */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* الهيدر */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 var(--space-4);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* اللوجو */

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  font-size: 0.95rem;
}

.app-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 40%;
  background: radial-gradient(circle at 30% 0, #fed7aa, #f97316 45%, #ea580c 80%);
  box-shadow: 0 0 16px rgba(248, 250, 252, 0.9);
}

/* layout بعد الهيدر */

.app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* السايدبار */

.app-sidebar {
  width: 260px;
  padding: var(--space-4);
  border-left: 1px solid rgba(15, 23, 42, 0.9);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: 0.15s ease-out;
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.9);
  color: inherit;
}

.sidebar-link:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--text-main);
}

.sidebar-link.is-active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
}

/*   --text-main: #e5e7eb;
  --text-muted: #9ca3af; */

.app-main {
  flex: 1;
  padding: var(--space-5);
  min-width: 0;
}

.app-main-inner {
  max-width: 900px;
  margin: 0 auto;
}

/* عنوان الصفحة */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* كروت */

.card {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 1) 65%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .card {
  background: linear-gradient(135deg, #ffffff, #e5e7eb);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* فورم */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.field-label {
  font-size: 0.85rem;
  color: var(--text-main);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input,
.select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: 0.15s ease-out;
}

html[data-theme="light"] .input,
html[data-theme="light"] .select {
  background: #f9fafb;
}

.input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.input:focus,
.select:focus {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.7);
}

/* ازرار */

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: 0.15s ease-out;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #020617;
  box-shadow: 0 16px 35px rgba(249, 115, 22, 0.6);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(249, 115, 22, 0.75);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

html[data-theme="light"] .btn-ghost {
  background: #ffffff;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 1);
}

/* زر ايقونة فقط */

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

/* بادج النتيجة */

.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
}

/* رسائل */

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.alert-success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.6);
  color: #bbf7d0;
}

.alert-error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.6);
  color: #fecaca;
}

/* مسافات صغيرة */

.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}

/* ايقونات العناوين والليبل */

.title-icon {
  margin-inline-start: 4px;
  margin-inline-end: 6px;
  font-size: 1.1em;
}

.label-icon {
  margin-inline-start: 2px;
  margin-inline-end: 4px;
}

.header-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ريسبونسيف  موبايل فيرست */

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

  .app-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    padding: var(--space-3) var(--space-4);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    overflow-x: auto;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .sidebar-link {
    font-size: 0.78rem;
    padding-inline: 10px;
  }

  .app-main {
    padding: var(--space-4);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .page-title {
    font-size: 1.2rem;
  }

  .card {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .app-header {
    padding-inline: var(--space-3);
    gap: var(--space-2);
  }

  .app-header-right {
    justify-content: flex-end;
  }

  .btn {
    padding-inline: 10px;
  }
}

/* رسائل النجاح والخطا في الوضع العادي لايت */
html[data-theme="light"] .alert-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.5);
  color: #166534; /* اخضر غامق واضح */
}

html[data-theme="light"] .alert-error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.5);
  color: #b91c1c; /* احمر غامق */
}


/* السايدبار في الوضع الفاتح */
html[data-theme="light"] .app-sidebar {
  background: #f9fafb;
  border-left-color: rgba(209, 213, 219, 0.9);
}

/* اللينكات العادية في السايدبار في الوضع الفاتح */
html[data-theme="light"] .sidebar-link {
  color: #374151;
}

/* شكل الايقونة داخل الدائرة في الوضع الفاتح */
html[data-theme="light"] .sidebar-link-icon {
  background: #e5e7eb;
  color: #111827;
}

/* الهوفر في الوضع الفاتح */
html[data-theme="light"] .sidebar-link:hover {
  background: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.8);
  color: #111827;
}
/* DNS records table */
.dns-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.dns-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-size: 0.85rem;
    background: var(--surface-raised);
    border-radius: 16px;
    overflow: hidden;
}

.dns-table thead {
    background: var(--surface-strong);
}

.dns-table th,
.dns-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: start;
    white-space: nowrap;
}

.dns-table th {
    font-weight: 600;
    opacity: 0.9;
}

.dns-table tr:last-child td {
    border-bottom: none;
}

.dns-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dns-table-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--danger-text);
}

.dns-table-delete i {
    font-size: 0.8rem;
}
