/* إلغاء أي margin أو padding افتراضي من الـ html و body */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* منع التمرير الأفقي */
}

body {
  background-image: url('media/fallback.jpg');
  background-size: cover;
  background-position: center;
  font-family: 'Quicksand', sans-serif;
  color: #fff;
  direction: rtl;
}

.overlay {
  background: rgba(0, 0, 0, 0.7);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: -5px;
  margin-bottom: 18px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  padding: 0.3rem 0.5rem;
  height: 35px;
  min-height: 35px;
  overflow: hidden;
}

.header .logo {
  width: 65px;
  order: 1;
  padding: .000000001cm .000000001cm .000000001cm 1cm;
}

.header h1 {
  font-family: 'Lalezar', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  margin: 0;
  order: 0;
  padding: 1px 50px 1px 1px;
}
.form-container {
  background: rgba(255, 255, 255, 0.2);
  padding: 1rem;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 350px;
  margin: 0.5rem 0; /* تقليل المسافة العلوية والسفلية */
}

.form-container h2 {
  font-family: 'Lalezar', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
  color: #ffd700;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form input,
.form select {
  padding: 0.6rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid #ffd700;
  outline: none;
  font-size: 0.9rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  text-align: right;
}

.form input:focus,
.form select:focus {
  border-color: #fff176;
}

.form input::placeholder,
.form select::placeholder {
  color: #ccc;
  font-family: 'Quicksand', sans-serif;
  text-align: right;
}

.form select {
  text-align-last: right;
  direction: rtl;
}

/* تصميم مخصص لزر رفع الملف */
.file-upload-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-upload-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1)); /* تدرج ذهبي خفيف */
  border: 1px solid rgba(255, 215, 0, 0.5); /* حدود ذهبية */
  border-radius: 8px; /* زوايا دائرية */
  backdrop-filter: blur(5px); /* تأثير بلور */
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-upload-label:hover {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.2));
  border-color: #ffd700;
}

.file-upload-label i {
  color: #ffd700; /* لون الأيقونة */
}

.file-name {
  color: #ccc;
  font-size: 0.8rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form button {
  background: #ffd700;
  color: #1a1a1a;
  padding: 0.6rem;
  border-radius: 0.4rem;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
}

.form button:disabled {
  background: #999;
  cursor: not-allowed;
}

.error {
  color: #ff5252;
  font-size: 0.8rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  margin-top: 0.2rem;
  display: none;
  text-align: right;
}

.general-error {
  color: #ff5252;
  font-size: 0.9rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  margin: 0.5rem 0;
  text-align: center;
  display: none;
}

.preview-container {
  margin-top: 0.8rem;
  text-align: center;
}

#idCardPreview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 0.4rem;
  border: 1px solid #ffd700;
}

.footer {
  text-align: center;
  margin-bottom: 0.5rem; /* تقليل المسافة السفلية */
  padding-bottom: 105px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.social-icons i {
  color: #ffd700;
  font-size: 1.5rem; /* تكبير الأيقونات */
}

.contact-us {
  margin: 0.3rem 0;
  font-size: 1rem;
  font-family: 'Lalezar', cursive; /* خط حلو */
  font-weight: 500;
  color: #ffd700;
}

.popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 1000;
}

.ticket {
  background: #fffde7;
  border: 2px solid #ffd700;
  border-radius: 0.5rem;
  padding: 1rem;
  width: 90%;
  max-width: 300px;
  text-align: center;
  color: #1a1a1a;
}

.form-title {
  font-family: 'Lalezar', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: #efeee8;
  text-align: center;
  margin: 0.5rem 0;
}

.ticket h2 {
  font-family: 'Lalezar', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #d81b60;
}

.ticket .ticket-info {
  margin: 0.4rem 0;
  font-size: 0.8rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  text-align: center;
}

.ticket #qrcode {
  margin: 0.8rem auto;
}

.ticket button {
  background: #d81b60;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  border: none;
  font-size: 0.9rem;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.loading-message {
  color: #00ccff;
  font-size: 0.9rem;
  font-family: 'Lalezar', cursive;
  font-weight: 700;
  text-align: center;
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid #00ccff;
  box-shadow: 0 0 10px #00ccff, 0 0 20px #00ccff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
      padding: 0.6rem 0.3rem; /* تقليل المسافات أكتر على الموبايل */
  }

  .header h1 {
      font-size: 1.6rem;
  }

  .header .logo {
      width: 80px;
  }

  .form-container {
      padding: 0.8rem;
      width: 95%;
      margin: 0.3rem 0; /* تقليل المسافة أكتر على الموبايل */
  }

  .form-container h2 {
      font-size: 1.2rem;
  }

  .form input,
  .form select,
  .form button {
      font-size: 0.8rem;
      padding: 0.5rem;
  }

  .file-upload-label {
      font-size: 0.8rem;
      padding: 0.5rem 0.8rem;
  }

  .file-name {
      font-size: 0.7rem;
      max-width: 120px;
  }

  .error {
      font-size: 0.7rem;
  }

  .general-error {
      font-size: 0.8rem;
  }

  .social-icons i {
      font-size: 1.2rem; /* تكبير الأيقونات على الموبايل */
  }

  .contact-us {
      font-size: 0.9rem;
  }

  .ticket {
      padding: 0.8rem;
      max-width: 280px;
  }

  .ticket h2 {
      font-size: 1rem;
  }

  .ticket .ticket-info {
      font-size: 0.7rem;
  }

  .loading-message {
      font-size: 0.8rem;
      padding: 0.4rem;
  }
}