input[type="range"],
input[type="date"] {
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
  margin-bottom: 10px;
}

textarea {
  width: -webkit-fill-available;
  min-height: 120px;
}

button {
  cursor: pointer;
  border: none;
}

.alert {
  position: fixed;
  top: 20px;
  right: -300px; /* تبدأ برا الشاشة */
  background: #ff4444;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  display: block;
  min-width: 220px;
  text-align: left;
  font-size: 16px;
  z-index: 9999;
  transition: right 0.4s ease; /* الانيميشن */
}

.alert.show {
  right: 20px; /* تدخل الشاشة */
}

.success {
  background: #4caf50;
}

/* Markdown preview rendering (works without Tailwind Typography) */
.md-rendered h1 { font-size: 1.875rem; font-weight: 700; margin: 0.6em 0; }
.md-rendered h2 { font-size: 1.5rem; font-weight: 700; margin: 0.6em 0; }
.md-rendered h3 { font-size: 1.25rem; font-weight: 600; margin: 0.6em 0; }
.md-rendered h4 { font-size: 1.1rem; font-weight: 600; margin: 0.6em 0; }
.md-rendered p { margin: 0.6em 0; line-height: 1.6; }
.md-rendered ul { list-style: disc; padding-left: 1.5em; margin: 0.6em 0; }
.md-rendered ol { list-style: decimal; padding-left: 1.5em; margin: 0.6em 0; }
.md-rendered li { margin: 0.25em 0; }
.md-rendered a { color: #4f46e5; text-decoration: underline; }
.md-rendered hr { border: 0; border-top: 1px solid #e5e7eb; margin: 1em 0; }
.md-rendered pre {
  margin: 0.6em 0;
  background: #111827;
  color: #f3f4f6;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
}
.md-rendered pre code { background: transparent; padding: 0; color: inherit; }
.md-rendered code {
  font-size: 0.9em;
  background: #e5e7eb;
  padding: 0.1em 0.3em;
  border-radius: 0.25rem;
}
.md-rendered img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5em 0;
}
.md-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 0.95em;
}
.md-rendered th, .md-rendered td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.md-rendered th {
  background: #f3f4f6;
  font-weight: 600;
}
.md-rendered tr:nth-child(even) td { background: #fafafa; }
.md-rendered blockquote {
  border-left: 4px solid #c7d2fe;
  background: #eef2ff;
  padding: 0.5rem 1rem;
  margin: 0.6em 0;
  color: #4338ca;
  border-radius: 0 0.5rem 0.5rem 0;
}
.md-rendered input[type="checkbox"] { margin-right: 0.4em; }
.md-rendered ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0.5em; }
