/**
 * تصميم فاخر لصفحة تسجيل الدخول
 * تصميم عصري مع تأثيرات متقدمة وألوان جذابة
 *
 * @version 2.0
 * @author System Developer
 */

/* إعادة تعيين عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

/* متغيرات CSS */
:root {
  --primary-color: #0f2a47;
  --primary-dark: #0a1e33;
  --primary-light: #1e4976;
  --secondary-color: #e091b9;
  --accent-color: #ffffff;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --text-color: #ffffff;
  --error-color: #ef4444;
  --success-color: #10b981;
  --card-bg: rgba(255, 255, 255, 0.9);
  --input-bg: #1e4976;
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus-bg: #2a5a8a;
  --transition-speed: 0.3s;
  --gradient-bg: linear-gradient(135deg, #e091b9 0%, #7873f5 100%);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --text-dark: #333333;
}

/* تنسيق الجسم */
body.premium-login {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  direction: rtl;
  overflow: hidden;
  position: relative;
  font-family: 'Tajawal', sans-serif;
  background: #000;
}

/* خلفية متحركة */
.premium-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../images/backgrounds/download.gif') center center;
  background-size: cover;
  z-index: -2;
  overflow: hidden;
  opacity: 0.6;
  filter: brightness(1.2) contrast(0.9);
  transition: background-image 1s ease, opacity 1s ease, filter 1s ease;
}

/* إزالة تأثيرات الجسيمات والخطوط لتبسيط التصميم */
.particles, .gold-lines {
  display: none;
}

/* حاوية النموذج */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 35px 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
  overflow: hidden;
  animation: card-appear 0.5s forwards ease-out;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

@keyframes border-glow {
  0% {
    opacity: 0.5;
    filter: blur(3px);
  }
  100% {
    opacity: 0.8;
    filter: blur(1px);
  }
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* زر الإغلاق */
.close-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 2;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* شعار الشركة */
.company-logo {
  margin-bottom: 25px;
  text-align: center;
  animation: logo-appear 1.2s forwards ease-out;
  position: relative;
}

.logo-image {
  max-width: 180px;
  height: auto;
  border-radius: 10px;
  filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.4));
  transition: all 0.5s ease;
  transform-origin: center center;
  animation: logo-glow 3s infinite alternate ease-in-out;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* تأثير توهج الشعار */
@keyframes logo-glow {
  0% {
    filter: drop-shadow(0 5px 15px rgba(212, 175, 55, 0.3));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.5));
    transform: scale(1.02);
  }
}

@keyframes logo-appear {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* عنوان تسجيل الدخول */
.login-title {
  color: var(--text-color);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 25px;
  position: relative;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: title-appear 1.4s forwards ease-out;
  letter-spacing: 0.5px;
}

.login-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gold-color);
  border-radius: 2px;
  animation: title-line 2s infinite alternate;
}

@keyframes title-line {
  0% {
    width: 30px;
    opacity: 0.7;
  }
  100% {
    width: 80px;
    opacity: 1;
  }
}

@keyframes title-appear {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* مجموعة الإدخال */
.input-group {
  position: relative;
  margin-bottom: 25px;
  animation: input-appear 0.6s forwards ease-out;
  animation-fill-mode: both;
  opacity: 0;
}

.input-group:nth-child(1) {
  animation-delay: 0.6s;
}

.input-group:nth-child(2) {
  animation-delay: 0.8s;
}

.input-group:nth-child(3) {
  animation-delay: 1s;
}

@keyframes input-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* أيقونة الإدخال */
.input-icon {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: white;
  font-size: 18px;
  transition: all 0.3s ease;
  pointer-events: none;
}

/* حقول الإدخال */
.login-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: rgba(30, 73, 118, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: white;
  font-size: 16px;
  transition: all 0.3s ease, background 0.5s ease, border-color 0.5s ease;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.login-input:focus {
  outline: none;
  background: rgba(42, 90, 138, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.login-input:focus::placeholder {
  opacity: 0.9;
}

/* تنسيق قائمة اختيار الفرع */
select.login-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f8b500' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  background-size: 1rem;
  padding-left: 2.5rem;
}

select.login-input option {
  color: #333;
  background-color: #fff;
  padding: 0.5rem;
}

.branch-code {
  color: var(--gold-color);
  font-size: 0.9em;
  margin-right: 0.3rem;
}

/* تحسين مظهر قائمة الفروع */
select.login-input option:hover,
select.login-input option:focus {
  background-color: #fff8e6;
}

select.login-input option:first-child {
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

/* تنسيق التعليمات التوضيحية */
.branch-info {
  margin-top: -5px;
  margin-bottom: 20px;
  text-align: center;
}

.branch-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  line-height: 1.5;
  padding: 8px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: pulse 2s infinite ease-in-out;
}

/* تأثير النبض */
@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

.branch-hint strong {
  color: var(--gold-color);
  font-weight: bold;
  display: block;
  margin-top: 4px;
}

/* تذكرني ونسيت كلمة المرور */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 10px;
}

.checkbox-container {
  display: flex;
  align-items: center;
}

.auth-checkbox {
  margin-left: 8px;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-container label {
  color: var(--text-dark);
  font-size: 14px;
}

.forgot-password {
  color: var(--primary-light);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* رسائل الخطأ والنجاح */
.error-message {
  background-color: rgba(255, 82, 82, 0.2);
  color: #ff5252;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid rgba(255, 82, 82, 0.3);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.success-message {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  animation: bounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* زر تسجيل الدخول */
.login-button {
  width: 100%;
  padding: 12px;
  background-color: white;
  border: none;
  border-radius: 25px;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  letter-spacing: 1px;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  background-color: #f8f8f8;
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0;
}

/* تأثير التموج */
.ripple {
  position: absolute;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(248, 181, 0, 0.5) 50%, rgba(248, 181, 0, 0.2) 100%);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.8s cubic-bezier(0.11, 0.65, 0.33, 1);
  pointer-events: none;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }
  100% {
    transform: scale(5);
    opacity: 0;
  }
}

/* تصميم متجاوب */
@media (max-width: 480px) {
  .login-container {
    max-width: 90%;
    padding: 30px 20px;
  }

  .login-title {
    font-size: 22px;
  }

  .login-input {
    padding: 14px 14px 14px 40px;
    font-size: 14px;
  }

  .input-icon {
    font-size: 16px;
  }

  .logo-image {
    max-width: 150px;
    padding: 8px;
  }

  .login-button {
    font-size: 16px;
    padding: 14px;
  }
}
