* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #1e1e1e;
  color: #fff;
  font-size: 18px;
  transition: background 0.4s, color 0.4s;
}

.wrapper {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ----- SIDEBAR ----- */
.sidebar {
  width: 260px;
  background: #222;
  padding: 25px 20px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.4s ease, background 0.3s;
  z-index: 1000;
  animation: slideInSidebar 0.6s ease-out;
}

@keyframes slideInSidebar {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.sidebar h2 {
  color: #ffcc00;
  text-align: center;
  margin-bottom: 25px;
  animation: fadeIn 1s ease-in;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 12px 10px;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
  animation-delay: calc(0.1s * var(--i));
}

@keyframes fadeUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sidebar li:hover,
.sidebar li.active {
  background: #ffcc00;
  color: #000;
  font-weight: bold;
  transform: scale(1.03);
}

/* ----- MAIN CONTENT ----- */
.main-content {
  margin-left: 280px;
  flex-grow: 1;
  padding: 25px;
  transition: margin-left 0.3s ease;
  animation: fadeIn 0.8s ease-in;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  animation: fadeDown 0.8s ease;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 1.8rem;
  color: #ffcc00;
}

/* ----- MENU BUTTON ----- */
.menu-btn {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.menu-btn:hover {
  transform: rotate(90deg);
}

/* ----- SWITCH MODE ----- */
.toggle-switch {
  width: 60px;
  height: 30px;
  background: #555;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.switch-knob {
  width: 26px;
  height: 26px;
  background: #ffcc00;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: left 0.3s, background 0.3s, transform 0.3s;
}

.switch-knob:hover {
  transform: scale(1.1);
}

/* ----- CARD ----- */
.card {
  background: #282c34;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.3s, color 0.3s, transform 0.3s;
  animation: fadeUp 0.6s ease forwards;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.card h3 {
  color: #ffcc00;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.card ul {
  padding-left: 20px;
  margin: 15px 0;
}

.card ul li {
  margin: 6px 0;
  transition: transform 0.3s;
}

.card ul li:hover {
  transform: translateX(5px);
}

.property {
  display: inline-block;
  background: #ffcc00;
  color: #000;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  transition: transform 0.3s;
}

.property:hover {
  transform: scale(1.05);
}

/* ----- LIGHT MODE ----- */
body.light-mode {
  background: #f4f4f4;
  color: #000;
}

body.light-mode .sidebar {
  background: #eaeaea;
  color: #000;
}

body.light-mode .card {
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
}

body.light-mode .toggle-switch {
  background: #ccc;
}

body.light-mode .switch-knob {
  left: 32px;
  background: #333;
}

.sidebar li {
  font-size: 16px;
  padding: 12px 10px;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

/* النص يأخذ المساحة المتبقية */
.sidebar li span {
  flex-grow: 1;
}

/* أيقونة النهاية على اليمين */
.sidebar li i.fa-chevron-right {
  margin-left: auto; /* تدفعها إلى أقصى اليمين */
  color: #fff;
  transition: transform 0.3s;
}

/* عند التفعيل */
.sidebar li.active i.fa-chevron-right {
  transform: rotate(90deg);
  color: #000;
}


/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .menu-btn {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }
}
