/**
 * Magazine Section Stylesheet - Modern & Responsive White Theme
 */

/* ---- Magazine Section Base ---- */
.magazine-section {
  width: 100%;
  min-height: 100vh;
  padding-top: 4cm;
  padding-bottom: 4cm;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  background-color: #ffffff; /* خلفية بيضاء ناصعة */
  display: flex;
  justify-content: center;
  align-items: center;
}

.magazine-container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ---- Section Header ---- */
.magazine-header {
  text-align: center;
}

.magazine-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #000000;
  margin-bottom: 0.75rem;
}

.magazine-subtitle {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ---- Top Box Layout (Magazine Right + Text Left) ---- */
.magazine-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  min-height: 380px;
  position: relative;
  padding: 1rem 0;
}

/* Magazine Image Container (Right Side - Enlarged) */
.magazine-drag-wrapper {
  flex-shrink: 0;
  width: 280px; /* تكبير أيقونة المجلة */
  position: relative;
  display: flex;
  justify-content: center;
}

.magazine-card-item {
  width: 280px; /* تكبير الحجم بشكل واضح وممتاز */
  cursor: grab;
  user-select: none;
  touch-action: none;
  position: relative;
  z-index: 10;
  border-radius: 16px;
  
  
}

.magazine-card-item:active {
  cursor: grabbing;
}

.magazine-card-item.is-dragging {
  opacity: 0.92;
  box-shadow: 0 25px 50px -12px rgba(111, 0, 255, 0.3);
  z-index: 100;
}

.magazine-cover-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  pointer-events: none;
}

.drag-hint-badge {
  position: absolute;
  top: -12px;
  right: -10px;
  background-color: #6f00ff;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(111, 0, 255, 0.35);
  pointer-events: none;
  animation: bounceHint 2s infinite;
}

@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Description Text (Left Side on Desktop Hover) */
.magazine-description-wrapper {
  flex: 1;
  text-align: justify;
  text-justify: inter-word;
  line-height: 2;
  color: #000000;
  font-size: 1.1rem;
  font-weight: 500;
 
  padding: 1.8rem;

  transition: opacity 0.4s ease, transform 0.4s ease;
}

.magazine-description-text {
  margin: 0;
}

/* Desktop Hover Interaction for Description on Left */
@media (min-width: 1025px) {
  .magazine-description-wrapper {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
  }

  .magazine-preview-card:hover .magazine-description-wrapper,
  .magazine-drag-wrapper:hover ~ .magazine-description-wrapper {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
}

/* ---- Bottom Dropzone (Shopping Bag) ---- */
.magazine-dropzone-outer {
  width: 100%;
  background-color: #F4F1DF;
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.12);
}

.magazine-dropzone-inner {
  width: 100%;
  max-width: 540px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bag-image-container {
  width: 100%;
  max-width: 500px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center center;
  will-change: transform;
}

.bag-image-container.bag-near-hover {
  transform: scale(1.08);
}

.bag-image-container.bag-drag-over {
  transform: scale(1.14);
}

.bag-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  pointer-events: none;
}

/* ---- MODAL BASE & OVERLAY ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  width: min(92vw, 460px);
  min-height: 390px;
  border-radius: 28px;
  padding: 2.8rem 2.4rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: ltr;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-overlay.is-open .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #0f172a;
}

/* ---- ROBOT VERIFICATION MODAL ---- */
.robot-modal-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.robot-logo-wrapper {
  width: 110px;
  height: 110px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.robot-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.robot-modal-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #6f00ff;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.robot-checkbox-wrapper {
  margin-bottom: 2.5rem;
}

.robot-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.robot-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-checkmark {
  width: 26px;
  height: 26px;
  border: 2.5px solid #6f00ff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.check-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s ease;
}

.robot-checkbox-input:checked + .custom-checkmark {
  background-color: #10b981;
  border-color: #10b981;
}

.robot-checkbox-input:checked + .custom-checkmark .check-icon {
  opacity: 1;
  transform: scale(1);
}

.checkbox-text {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}

.cf-turnstile-hidden {
  display: none !important;
}

.robot-modal-footer {
  width: 100%;
  text-align: left;
  margin-top: auto;
}

.hafar-id-tag {
  font-size: 12px;
  font-weight: 600;
  color: #000000;
  letter-spacing: 0.05em;
  position: absolute;
  bottom: 1rem;
  left: 1.25rem;
}

/* ---- EMAIL MODAL STYLES ---- */
.email-modal-card {
  direction: rtl;
  text-align: right;
}

.email-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.email-modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.email-modal-desc {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.email-input {
  width: 100%;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background-color: #f8fafc;
  color: #000000;
  font-size: 1rem;
  direction: ltr;
  text-align: right;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.email-input:focus {
  border-color: #6f00ff;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(111, 0, 255, 0.1);
}

.input-error-msg {
  font-size: 0.85rem;
  color: #ef4444;
  display: none;
}

.input-group.has-error .email-input {
  border-color: #ef4444;
}

.input-group.has-error .input-error-msg {
  display: block;
}

.btn-submit-email {
  width: 100%;
  padding: 1.1rem;
  background-color: #6f00ff;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit-email:hover {
  background-color: #5a2fd6;
}

.btn-submit-email:active {
  transform: scale(0.98);
}

.btn-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.email-modal-status {
  text-align: center;
  padding: 1.5rem 0 0.5rem 0;
}

.status-success-icon {
  width: 52px;
  height: 52px;
  background-color: #d1fae5;
  color: #059669;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.status-msg {
  font-size: 1.1rem;
  font-weight: 600;
  color: #065f46;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* ---- RESPONSIVE MEDIA QUERIES (MOBILE & TABLET) ---- */
@media (max-width: 1024px) {
  .magazine-preview-card {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }

  .magazine-drag-wrapper,
  .magazine-card-item {
    width: 240px;
  }

  .magazine-description-wrapper {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .magazine-section {
    padding-top: 2cm;
    padding-bottom: 2cm;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .magazine-title {
    font-size: 1.6rem;
  }

  .magazine-subtitle {
    font-size: 1.1rem;
  }

  .magazine-description-wrapper {
    padding: 1.25rem;
  }

  .magazine-description-text {
    font-size: 1rem;
    line-height: 1.8;
  }

  .magazine-dropzone-outer {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .modal-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }

  .robot-modal-title {
    font-size: 1.3rem;
  }
}

.magazine-description,
.magazine-info,
.magazine-text,
.magazine-preview-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}