/* ========================================
   PLT HOSTING - نظام الثيم الموحد
   نظام ألوان متقدم مستوحى من اللوجو
   ======================================== */

:root {
  /* ===== الألوان الأساسية ===== */
  --primary-dark: #2d231f;
  /* بني داكن */
  --primary-brown: #4A3728;
  /* بني متوسط */
  --primary-light: #8a7a6f;
  /* بني فاتح */
  --accent-gold: #D4AF37;
  /* ذهبي */
  --accent-gold-light: #E5C158;
  /* ذهبي فاتح */

  /* ===== الخلفيات ===== */
  --bg-main: #1a1410;
  /* خلفية رئيسية داكنة */
  --bg-secondary: #2d231f;
  /* خلفية ثانوية */
  --bg-card: #3d332d;
  /* خلفية الكروت */
  --bg-card-hover: #4d433d;
  /* خلفية الكروت عند المرور */
  --bg-input: #3a2f28;
  /* خلفية الحقول - محسّنة للقراءة */
  --bg-code-editor: #2a2420;
  /* خلفية محرر الأكواد */

  /* ===== النصوص ===== */
  --text-primary: #F0EBE3;
  /* نص رئيسي */
  --text-secondary: #d4c4b5;
  /* نص ثانوي - محسّن للقراءة */
  --text-muted: #9a8a7f;
  /* نص باهت - محسّن للقراءة */
  --text-code: #E8DFD6;
  /* نص الأكواد */

  /* ===== الحدود والظلال ===== */
  --border-color: #4A3728;
  --border-light: #5d4a3a;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.6);
  --glow-gold: 0 0 20px rgba(212, 175, 55, 0.3);

  /* ===== الألوان الوظيفية ===== */
  --success: #10b981;
  --success-dark: #059669;
  --error: #ef4444;
  --error-dark: #dc2626;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --info: #3b82f6;
  --info-dark: #2563eb;

  /* ===== التدرجات ===== */
  --gradient-primary: linear-gradient(135deg, var(--primary-dark), var(--primary-brown));
  --gradient-gold: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  --gradient-success: linear-gradient(135deg, var(--success-dark), var(--success));
  --gradient-card: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));

  /* ===== الحركات والانتقالات ===== */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* ===== الخطوط ===== */
  --font-family: 'Cairo', sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

/* ===== إعدادات عامة ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== خلفية متحركة ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(74, 55, 40, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== الكروت ===== */
.card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-gold);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold);
}

.card:hover::before {
  opacity: 1;
}

/* ===== الأزرار ===== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--gradient-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-dark), var(--error));
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-outline:hover {
  background: var(--accent-gold);
  color: var(--primary-dark);
}

/* ===== الحقول ===== */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: all var(--transition-normal);
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.input::placeholder {
  color: var(--text-muted);
}

/* ===== التبويبات والقوائم ===== */
.nav-item {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  /* تحسين الرؤية */
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold-light);
}

.nav-item.active {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ===== الجداول ===== */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: var(--bg-secondary);
}

th {
  padding: 1rem;
  text-align: right;
  font-weight: 600;
  color: var(--accent-gold);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}

/* ===== الشارات ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border: 1px solid var(--error);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

/* ===== الإشعارات ===== */
.notification {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
  opacity: 0;
  transition: all var(--transition-normal);
  min-width: 300px;
}

.notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.notification-success {
  border-right: 4px solid var(--success);
}

.notification-error {
  border-right: 4px solid var(--error);
}

.notification-warning {
  border-right: 4px solid var(--warning);
}

.notification-info {
  border-right: 4px solid var(--info);
}

/* ===== تأثيرات الحركة ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.5s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== Scrollbar مخصص ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-brown);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* ===== تأثيرات التحميل ===== */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg-card) 0%,
      var(--bg-card-hover) 50%,
      var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ===== الشبكات ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ===== المسافات ===== */
.p-1 {
  padding: 0.25rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.m-1 {
  margin: 0.25rem;
}

.m-2 {
  margin: 0.5rem;
}

.m-3 {
  margin: 0.75rem;
}

.m-4 {
  margin: 1rem;
}

.m-6 {
  margin: 1.5rem;
}

.m-8 {
  margin: 2rem;
}

/* ===== النصوص ===== */
.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-gold {
  color: var(--accent-gold);
}

.text-success {
  color: var(--success);
}

.text-error {
  color: var(--error);
}

.text-warning {
  color: var(--warning);
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* ===== المحاذاة ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* ===== الحدود ===== */
.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: 9999px;
}

/* ===== الظلال ===== */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* ===== المساعدين ===== */
.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

/* ===== تأثيرات خاصة ===== */
.glow {
  box-shadow: var(--glow-gold);
}

.glass {
  background: rgba(61, 51, 45, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(212, 175, 55, 0.2),
      transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* ===== محرر الأكواد ===== */
.code-editor,
.file-editor,
textarea.code,
pre.code {
  background: var(--bg-code-editor) !important;
  color: var(--text-code) !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 1.6;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.code-editor:focus,
.file-editor:focus,
textarea.code:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Syntax highlighting for code */
.code-keyword {
  color: #E5C158;
}

.code-string {
  color: #98C379;
}

.code-number {
  color: #D19A66;
}

.code-comment {
  color: var(--text-muted);
  font-style: italic;
}

.code-function {
  color: #61AFEF;
}

.code-variable {
  color: #E06C75;
}

/* Select and dropdown improvements */
select,
.select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

select:focus,
.select:focus {
  border-color: var(--accent-gold);
  outline: none;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}