* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  direction: rtl;
  background-color: #090a0f;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease;
}

/* إضاءة الغرفة عند تشغيل اللمبة */
body.light-on {
  background: radial-gradient(circle at 25% 30%, #4d3c14 0%, #161822 55%, #090a0f 100%);
}

/* تقسيم الشاشة المتجاوب */
.split-screen {
  min-height: 100vh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* القسم الأيمن: تسجيل الدخول */
.right-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-box {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 224, 102, 0.4);
  padding: 35px 30px;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  opacity: 0;
  transform: translateX(30px) scale(0.96);
  pointer-events: none;
  transition: all 0.45s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

body.light-on .login-box {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 22px;
  color: #ffe066;
  font-size: 24px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #cbd5e1;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 16px;
  outline: none;
}

.input-group input:focus {
  border-color: #ffe066;
}

.error-msg {
  color: #f87171;
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
  display: none;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: #ffe066;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-login:hover {
  background: #ffd43b;
}

/* القسم الأيسر: اللمبة والحبل */
.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}

.lamp-btn {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  padding: 10px;
  -webkit-tap-highlight-color: transparent;
}

.lamp-btn svg {
  width: 220px;
  height: auto;
  overflow: visible;
}

.cord-group {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lamp-btn:active .cord-group,
.lamp-btn.pulled .cord-group {
  transform: translateY(22px);
}

.bulb-glass {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
  transition: all 0.3s ease;
}

.bulb-filament {
  stroke: #475569;
  stroke-width: 2.5;
  fill: none;
  transition: stroke 0.3s ease;
}

body.light-on .bulb-glass {
  fill: #ffe066;
  stroke: #fff3bf;
  filter: drop-shadow(0 0 30px #fcc419) drop-shadow(0 0 70px #f59f00);
}

body.light-on .bulb-filament {
  stroke: #ffffff;
}

.hint {
  margin-top: 10px;
  font-size: 15px;
  color: #94a3b8;
  text-align: center;
  animation: pulse 2s infinite;
}

body.light-on .hint {
  color: #ffe066;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* صفحة جدول المواعيد بعد تسجيل الدخول */
.app-container {
  display: none;
  position: fixed;
  inset: 0;
  background: #f1f5f9;
  color: #0f172a;
  z-index: 500;
  flex-direction: column;
  overflow-y: auto;
}

body.logged-in .app-container {
  display: flex;
}

.navbar {
  background: #fff;
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-turn-off {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.schedule-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 30px auto 50px;
  padding: 0 20px;
}

.schedule-header {
  margin-bottom: 20px;
}

.schedule-header h1 {
  font-size: 26px;
  color: #0f172a;
}

.schedule-header p {
  color: #64748b;
  font-size: 14px;
  margin-top: 4px;
}

.add-task-card {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  display: grid;
  grid-template-columns: 1fr 145px 130px 110px;
  gap: 12px;
  margin-bottom: 25px;
}

.add-task-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}

.btn-add {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  padding: 12px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  border-right: 4px solid #eab308;
}

.task-item.done {
  opacity: 0.65;
  border-right-color: #22c55e;
}

.task-item.done .task-title {
  text-decoration: line-through;
}

.task-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  word-break: break-word;
}

.task-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.task-time {
  font-size: 13px;
  color: #64748b;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-action {
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-done {
  background: #dcfce7;
  color: #166534;
}

.btn-delete {
  background: #fee2e2;
  color: #991b1b;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  font-size: 15px;
}

/* التجاوب الكامل مع التابلت والتليفون */
@media (max-width: 768px) {
  .split-screen {
    flex-direction: column-reverse;
    justify-content: flex-end;
    padding: 0 20px 40px;
    gap: 25px;
  }
  .left-panel {
    align-self: center;
  }
  .lamp-btn svg {
    width: 150px;
  }
  .right-panel {
    width: 100%;
  }
  .add-task-card {
    grid-template-columns: 1fr;
  }
  .task-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .task-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
  }
}
/* تنسيق صندوق التنبيه والمنبه */
.alarm-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #0f172a;
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  border-right: 5px solid #eab308;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  max-width: 90%;
  width: 380px;
  transform: translateY(150%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alarm-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.alarm-toast.urgent {
  border-right-color: #ef4444;
  background: #1e1b1b;
}

.alarm-icon {
  font-size: 28px;
}

.alarm-details {
  flex: 1;
}

.alarm-details strong {
  display: block;
  font-size: 15px;
  color: #ffe066;
  margin-bottom: 3px;
}

.alarm-toast.urgent .alarm-details strong {
  color: #f87171;
}

.alarm-details p {
  font-size: 13px;
  color: #cbd5e1;
}

.btn-close-alarm {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.btn-close-alarm:hover {
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
  .alarm-toast {
    right: 5%;
    width: 90%;
    bottom: 15px;
  }
}