:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.8);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

.dark {
  --bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

* {
  box-sizing: border-box;
  transition: all 0.25s ease;
}

/* ===== BODY ===== */
body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* ===== BACKGROUND ===== */
.background-blobs {
  position: fixed;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(99, 102, 241, 0.1),
      transparent 40%
    ),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.1), transparent 40%);
}

/* ===== CONTAINER ===== */
.settings-container {
  width: 100%;
  max-width: 1000px;
  padding: 2rem;
}

/* ===== HEADER ===== */
.settings-header {
  text-align: center;
  margin-bottom: 2rem;
}

.settings-header h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.settings-header p {
  color: var(--text-muted);
}

/* ===== GRID ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

/* تنسيق حاوية كلمة المرور */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 15px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s;
}

.toggle-password:hover {
  color: var(--primary);
}
@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* هذا الجزء سيجعل "Profile Information" يأخذ العرض بالكامل */
.profile-section {
  grid-column: 1 / -1;
}

/* لتحسين الشكل وجعل الحقول بجانب بعضها داخل البوكس العريض */
@media (min-width: 768px) {
  .profile-section {
    display: grid;
    grid-template-columns: auto 1fr; /* الصورة في جهة والبيانات في جهة */
    gap: 30px;
    align-items: center;
  }

  /* جعل حقول الإدخال تأخذ مساحة متساوية */
  .profile-section .input-group {
    margin-bottom: 20px;
  }
}
/* ===== CARD ===== */
.settings-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(99, 102, 241, 0.15),
    transparent
  );
  transform: rotate(25deg);
  top: -100%;
  left: -100%;
  transition: 0.6s;
}

.settings-card:hover {
  transform: translateY(-4px);
}

.settings-card:hover::before {
  top: 100%;
  left: 100%;
}
/* ===== CARD HEADER ===== */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.card-header i {
  color: var(--primary);
}

.card-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

/* ===== PROFILE IMAGE ===== */
.profile-upload {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.image-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
}

#previewImage {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}

.upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--primary);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: 2px solid var(--bg);
}

/* ===== INPUTS ===== */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ===== TOGGLES ===== */
.toggle-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}

.toggle-info span {
  font-weight: 600;
}

.toggle-info small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #cbd5e1;
  border-radius: 30px;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: 0.3s;
}

input:checked + .slider {
  background: var(--primary);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* ===== BUTTONS ===== */
.main-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}

.main-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* Logout Button */
.danger-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 10px;
  border: none;
  background: #ef4444;
  color: white;
  cursor: pointer;
}

.danger-btn:hover {
  background: #dc2626;
}

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  transform: translateX(120%);
}

.toast.show {
  transform: translateX(0);
}

/* ===== BACK BUTTON ===== */
.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 14px;
  border-radius: 50px;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.back-home-btn:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

.dark .back-home-btn:hover {
  background: var(--primary);
  color: white;
}

/* RTL */
[dir="rtl"] .back-home-btn:hover {
  transform: translateX(4px);
}

.settings-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.6s ease forwards;
}

.settings-card:nth-child(1) {
  animation-delay: 0.1s;
}
.settings-card:nth-child(2) {
  animation-delay: 0.2s;
}
.settings-card:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
