/* 
 * أنماط الواجهة الأمامية
 * 
 * @package FW_Coupon_Manager
 */

:root {
  --fw-primary: #4361ee;
  --fw-primary-hover: #3a56d4;
  --fw-success: #2ecc71;
  --fw-warning: #f39c12;
  --fw-danger: #e74c3c;
  --fw-light: #f8f9fa;
  --fw-dark: #2d3748;
  --fw-gray: #718096;
  --fw-gray-light: #e2e8f0;
  --fw-border-radius: 8px;
  --fw-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --fw-transition: all 0.3s ease;
  --fw-popup-overlay-bg: rgba(0, 0, 0, 0.5);
  --fw-popup-bg: white;
  --fw-popup-width: 500px;
  --fw-popup-border-radius: 12px;
  --fw-popup-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* ===== نموذج الكوبون ===== */
.fw-coupon-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.fw-form {
  width: 100%;
}

.fw-form-group {
  margin-bottom: 1.5rem;
}

.fw-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--fw-dark);
}

.fw-form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--fw-gray-light);
  border-radius: var(--fw-border-radius);
  font-size: 1rem;
  transition: var(--fw-transition);
}

.fw-form-control:focus {
  outline: none;
  border-color: var(--fw-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.fw-form-help {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--fw-gray);
}

.fw-input-group {
  display: flex;
}

.fw-input-group .fw-form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.fw-input-group .fw-button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ===== الأزرار ===== */
.fw-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--fw-border-radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: var(--fw-transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.fw-button-primary {
  background: var(--fw-primary);
  color: white;
}

.fw-button-primary:hover {
  background: var(--fw-primary-hover);
  transform: translateY(-2px);
}

/* تأثير الموجة عند النقر */
.fw-button::after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.fw-button:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

.fw-button-text {
  display: inline-block;
}

.fw-button-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.fw-button:hover .fw-button-icon {
  transform: translateX(3px);
}

/* ===== التنبيهات ===== */
.fw-alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--fw-border-radius);
  margin-bottom: 1.5rem;
  animation: slideInDown 0.4s ease forwards;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fw-alert-success {
  background-color: #d1fae5;
  color: #065f46;
}

.fw-alert-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.fw-alert-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.fw-alert-info {
  background-color: #e0f2fe;
  color: #0369a1;
}

.fw-alert-icon {
  flex-shrink: 0;
  color: currentColor;
  animation: bounceIn 0.6s ease;
}

.fw-alert-content {
  flex: 1;
}

/* أيقونة التحميل */
.fw-loading-icon {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== النافذة المنبثقة ===== */
.fw-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--fw-popup-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1), visibility 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  backdrop-filter: blur(0px);
}

.fw-popup-overlay.active {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(2px);
}

.fw-popup {
  background-color: var(--fw-popup-bg);
  width: 90%;
  max-width: var(--fw-popup-width);
  border-radius: var(--fw-popup-border-radius);
  box-shadow: var(--fw-popup-shadow);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.fw-popup-overlay.active .fw-popup {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.fw-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--fw-gray-light);
}

.fw-popup-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fw-dark);
  opacity: 0;
  transform: translateX(-10px);
  animation: fadeInRight 0.5s ease 0.2s forwards;
}

.fw-popup-close {
  background: transparent;
  border: none;
  color: var(--fw-gray);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0;
  transform: rotate(-90deg);
  animation: fadeInRotate 0.5s ease 0.3s forwards;
}

.fw-popup-close:hover {
  background-color: var(--fw-gray-light);
  color: var(--fw-dark);
  transform: rotate(90deg);
}

.fw-popup-content {
  padding: 1.5rem;
}

.fw-popup-content .fw-form-label,
.fw-popup-content .fw-form-control,
.fw-popup-content .fw-button,
.fw-popup-content .fw-form-help {
  opacity: 0;
  transform: translateY(10px);
}

.fw-popup-overlay.active .fw-popup-content .fw-form-label {
  animation: fadeInUp 0.5s ease 0.3s forwards;
}

.fw-popup-overlay.active .fw-popup-content .fw-form-control {
  animation: fadeInUp 0.5s ease 0.4s forwards;
}

.fw-popup-overlay.active .fw-popup-content .fw-button {
  animation: fadeInUp 0.5s ease 0.5s forwards;
}

.fw-popup-overlay.active .fw-popup-content .fw-form-help {
  animation: fadeInUp 0.5s ease 0.6s forwards;
}

/* تأثير عند إغلاق النافذة المنبثقة */
.fw-popup-overlay.closing {
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.fw-popup-overlay.closing .fw-popup {
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== التجاوب مع الشاشات المختلفة ===== */
@media (max-width: 768px) {
  .fw-popup {
    width: 95%;
  }
  
  .fw-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .fw-popup-header {
    padding: 0.75rem 1rem;
  }
  
  .fw-popup-content {
    padding: 1rem;
  }
  
  .fw-popup-title {
    font-size: 1.1rem;
  }
  
  .fw-input-group {
    flex-direction: column;
  }
  
  .fw-input-group .fw-form-control {
    border-radius: var(--fw-border-radius);
    margin-bottom: 0.5rem;
  }
  
  .fw-input-group .fw-button {
    border-radius: var(--fw-border-radius);
  }
}

/* ===== تأثيرات حركية ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRotate {
  from {
    opacity: 0;
    transform: rotate(-90deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تأثير اللمس للأجهزة المحمولة */
.touch-active {
  transform: scale(0.97);
}
