/* =====================================================
   نظام الطيبات - Weekly Plan Page
   ===================================================== */

/* ===== Intro Section ===== */
.wp-intro {
  background: linear-gradient(135deg, #1a3d2b 0%, #0f2a1c 50%, #1a3d2b 100%);
  color: #faf8f2;
  padding: 60px 20px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.wp-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(201, 168, 76, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.wp-intro-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.wp-intro-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(201, 168, 76, 0.2);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #e8c96a;
  margin-bottom: 20px;
  font-weight: 600;
}

.wp-intro-title {
  font-family: 'Amiri', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 20px;
  line-height: 1.4;
}

.wp-intro-subtitle {
  font-size: 1.05rem;
  line-height: 1.9;
  color: rgba(250, 248, 242, 0.85);
  margin: 0 0 28px;
}

.wp-intro-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wp-feature {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: rgba(250, 248, 242, 0.95);
}

@media (max-width: 600px) {
  .wp-intro {
    padding: 40px 16px;
  }
  .wp-intro-title {
    font-size: 1.7rem;
  }
  .wp-intro-subtitle {
    font-size: 0.95rem;
  }
  .wp-feature {
    font-size: 0.78rem;
    padding: 6px 12px;
  }
}

/* ===== Form Section ===== */
.wp-form-section {
  padding: 40px 20px 60px;
  max-width: 800px;
  margin: 0 auto;
}

.wp-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 30px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.15);
}

.wp-card-title {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  color: #1a3d2b;
  margin: 0 0 28px;
  text-align: center;
  border-bottom: 2px solid #c9a84c40;
  padding-bottom: 14px;
}

.wp-question {
  margin-bottom: 28px;
}

.wp-question-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #1a3d2b;
  margin-bottom: 14px;
}

.wp-question-hint {
  font-weight: 400;
  color: #888;
  font-size: 0.85rem;
}

.wp-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.wp-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  background: #faf8f2;
  border: 2px solid #e8e2d4;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: #444;
  text-align: center;
  min-height: 95px;
}

.wp-option:hover {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.05);
  transform: translateY(-2px);
}

.wp-option.selected {
  background: linear-gradient(135deg, #1a3d2b 0%, #2d6b4a 100%);
  border-color: #c9a84c;
  color: #faf8f2;
  box-shadow: 0 4px 12px rgba(26, 61, 43, 0.25);
}

.wp-option.selected .wp-option-emoji {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wp-option-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.wp-option-text {
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .wp-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .wp-option {
    padding: 14px 8px;
    min-height: 80px;
  }
  .wp-option-emoji {
    font-size: 1.5rem;
  }
  .wp-option-text {
    font-size: 0.82rem;
  }
}

/* Notes textarea */
.wp-notes {
  width: 100%;
  min-height: 80px;
  padding: 14px;
  border: 1.5px solid #e8e2d4;
  border-radius: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  background: #faf8f2;
  color: #333;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.wp-notes:focus {
  outline: none;
  border-color: #c9a84c;
  background: #fff;
}

.wp-notes-count {
  text-align: left;
  font-size: 0.78rem;
  color: #888;
  margin-top: 4px;
}

/* Generate button */
.wp-generate-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #1a3d2b 0%, #2d6b4a 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(26, 61, 43, 0.3);
}

.wp-generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 61, 43, 0.4);
}

.wp-generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.wp-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wp-disclaimer {
  text-align: center;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.7;
  margin: 18px 0 0;
}

/* ===== Loading Section ===== */
.wp-loading-section {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.wp-loading-card {
  text-align: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.wp-loading-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  position: relative;
}

.wp-spinner-ring {
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: wpSpin 1.5s linear infinite;
}

.wp-spinner-ring:nth-child(2) {
  inset: 8px;
  border-top-color: #1a3d2b;
  animation-duration: 1.2s;
  animation-direction: reverse;
}

.wp-spinner-ring:nth-child(3) {
  inset: 16px;
  border-top-color: #2d6b4a;
  animation-duration: 0.9s;
}

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

.wp-loading-title {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: #1a3d2b;
  margin: 0 0 8px;
}

.wp-loading-subtitle {
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 24px;
  min-height: 24px;
  transition: opacity 0.3s;
}

.wp-loading-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.wp-loading-tip {
  font-size: 0.85rem;
  color: #888;
}

/* ===== Result Section ===== */
.wp-result-section {
  padding: 30px 20px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.wp-result-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 24px;
  background: linear-gradient(135deg, rgba(26, 61, 43, 0.04) 0%, rgba(201, 168, 76, 0.04) 100%);
  border-radius: 20px;
  border: 1px solid rgba(201, 168, 76, 0.15);
}

.wp-result-title {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  color: #1a3d2b;
  margin: 0 0 12px;
  line-height: 1.4;
}

.wp-result-intro {
  font-size: 1rem;
  color: #555;
  line-height: 1.8;
  margin: 0 0 20px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.wp-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wp-action-btn {
  padding: 10px 18px;
  background: #1a3d2b;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wp-action-btn:hover {
  background: #2d6b4a;
  transform: translateY(-1px);
}

.wp-action-btn-secondary {
  background: #fff;
  color: #1a3d2b;
  border: 1.5px solid #1a3d2b;
}

.wp-action-btn-secondary:hover {
  background: #1a3d2b;
  color: #fff;
}

/* ===== Days Tabs ===== */
.wp-days-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.wp-day-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #fff;
  border: 1.5px solid #e8e2d4;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
}

.wp-day-tab:hover {
  border-color: #c9a84c;
}

.wp-day-tab.active {
  background: linear-gradient(135deg, #1a3d2b 0%, #2d6b4a 100%);
  color: #fff;
  border-color: #c9a84c;
}

.wp-day-tab-emoji {
  font-size: 1.4rem;
}

.wp-day-tab-name {
  font-size: 0.85rem;
}

/* ===== Day Content ===== */
.wp-day-content {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  border: 1px solid rgba(201, 168, 76, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  animation: wpFadeIn 0.4s ease;
}

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

.wp-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #c9a84c30;
}

.wp-day-emoji-large {
  font-size: 2.5rem;
}

.wp-day-info {
  flex: 1;
}

.wp-day-name {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  color: #1a3d2b;
  margin: 0 0 4px;
}

.wp-day-focus {
  font-size: 0.95rem;
  color: #666;
}

.wp-meals {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wp-meal {
  background: #faf8f2;
  border-radius: 12px;
  padding: 16px 20px;
  border-right: 4px solid #c9a84c;
}

.wp-meal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wp-meal-emoji {
  font-size: 1.3rem;
}

.wp-meal-type {
  font-weight: 700;
  font-size: 1rem;
  color: #1a3d2b;
}

.wp-meal-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wp-meal-items li {
  padding: 4px 0;
  color: #444;
  font-size: 0.95rem;
  position: relative;
  padding-right: 18px;
}

.wp-meal-items li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: #c9a84c;
  font-size: 1.2rem;
  line-height: 1;
}

.wp-day-quote {
  margin-top: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.04));
  border-radius: 10px;
  border-right: 4px solid #c9a84c;
  font-family: 'Amiri', serif;
  font-style: italic;
  color: #555;
  line-height: 1.8;
}

.wp-day-quote::before {
  content: '"';
  font-size: 1.4rem;
  color: #c9a84c;
  margin-left: 4px;
}

.wp-day-quote-attr {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #888;
  font-style: normal;
}

/* ===== Weekly Tip ===== */
.wp-weekly-tip {
  margin-top: 30px;
  padding: 24px 26px;
  background: linear-gradient(135deg, #1a3d2b 0%, #2d6b4a 100%);
  color: #faf8f2;
  border-radius: 16px;
  text-align: center;
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  line-height: 1.8;
  box-shadow: 0 6px 20px rgba(26, 61, 43, 0.2);
}

.wp-weekly-tip-label {
  display: block;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.82rem;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
  font-style: normal;
}

/* ===== Error Section ===== */
.wp-error-section {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.wp-error-card {
  text-align: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 30px;
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #ffd1d1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.wp-error-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.wp-error-title {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  color: #a33;
  margin: 0 0 12px;
}

.wp-error-message {
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 24px;
  line-height: 1.7;
}

/* ===== Print styles ===== */
@media print {
  .site-header,
  .site-footer,
  .wp-intro,
  .wp-form-section,
  .wp-loading-section,
  .wp-error-section,
  .wp-result-actions,
  .wp-days-tabs,
  .ta-tg-banner,
  .ta-drawer {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .wp-result-section {
    padding: 0;
    max-width: 100%;
  }

  .wp-result-header {
    background: #fff;
    border: 2px solid #1a3d2b;
    page-break-after: avoid;
  }

  /* عرض كل الأيام في الطباعة */
  .wp-day-content {
    page-break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .wp-day-content[data-print-show="true"] {
    display: block !important;
  }
}

/* ===== Dark theme support ===== */
:root[data-theme="dark"] .wp-card,
[data-theme="dark"] .wp-card,
body.dark .wp-card {
  background: #1a1a1a;
  border-color: rgba(201, 168, 76, 0.3);
}

:root[data-theme="dark"] .wp-card-title,
[data-theme="dark"] .wp-card-title,
body.dark .wp-card-title {
  color: #e8c96a;
}

:root[data-theme="dark"] .wp-question-label,
[data-theme="dark"] .wp-question-label,
body.dark .wp-question-label {
  color: #f0f0f0;
}

:root[data-theme="dark"] .wp-option,
[data-theme="dark"] .wp-option,
body.dark .wp-option {
  background: #252525;
  border-color: #444;
  color: #ddd;
}

:root[data-theme="dark"] .wp-notes,
[data-theme="dark"] .wp-notes,
body.dark .wp-notes {
  background: #252525;
  border-color: #444;
  color: #f0f0f0;
}

:root[data-theme="dark"] .wp-day-content,
[data-theme="dark"] .wp-day-content,
body.dark .wp-day-content {
  background: #1a1a1a;
  border-color: rgba(201, 168, 76, 0.3);
}

:root[data-theme="dark"] .wp-meal,
[data-theme="dark"] .wp-meal,
body.dark .wp-meal {
  background: #252525;
}

:root[data-theme="dark"] .wp-day-name,
[data-theme="dark"] .wp-day-name,
body.dark .wp-day-name {
  color: #e8c96a;
}

/* =====================================================
   🎁 TELEGRAM REWARD SECTION
   ===================================================== */
.wp-reward-section {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.wp-reward-card {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 24px;
  border: 2px solid rgba(34, 158, 217, 0.15);
  box-shadow: 0 20px 60px rgba(34, 158, 217, 0.12);
  position: relative;
  overflow: hidden;
  animation: wpRewardFadeIn 0.5s ease;
}

@keyframes wpRewardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Decorative background */
.wp-reward-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(34, 158, 217, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wp-reward-card > * {
  position: relative;
  z-index: 1;
}

.wp-reward-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: wpRewardBounce 2s ease infinite;
}

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

.wp-reward-title {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  color: #1a3d2b;
  margin: 0 0 12px;
  line-height: 1.4;
}

.wp-reward-subtitle {
  font-size: 1rem;
  color: #555;
  margin: 0 0 24px;
  line-height: 1.7;
}

.wp-reward-box {
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.08) 0%, rgba(42, 171, 238, 0.08) 100%);
  border: 1.5px solid rgba(34, 158, 217, 0.2);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 24px;
  text-align: right;
}

.wp-reward-box-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1c8bc7;
  margin-bottom: 12px;
  text-align: center;
}

.wp-reward-box-text {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.8;
}

.wp-reward-benefits {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

.wp-reward-benefits li {
  padding: 6px 0;
  color: #444;
  font-size: 0.92rem;
}

.wp-reward-benefits li strong {
  color: #1c8bc7;
}

.wp-reward-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #229ED9 0%, #2AABEE 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.35);
}

.wp-reward-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34, 158, 217, 0.45);
}

.wp-reward-btn:active {
  transform: translateY(0);
}

.wp-reward-cancel {
  background: none;
  border: none;
  color: #888;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 16px;
  text-decoration: underline;
  transition: color 0.2s;
}

.wp-reward-cancel:hover {
  color: #555;
}

/* Mobile */
@media (max-width: 600px) {
  .wp-reward-card {
    padding: 30px 22px;
  }
  .wp-reward-icon {
    font-size: 3rem;
  }
  .wp-reward-title {
    font-size: 1.4rem;
  }
  .wp-reward-subtitle {
    font-size: 0.92rem;
  }
  .wp-reward-box {
    padding: 16px 18px;
  }
  .wp-reward-btn {
    padding: 14px 20px;
    font-size: 1rem;
  }
}

/* Dark theme */
:root[data-theme="dark"] .wp-reward-card,
[data-theme="dark"] .wp-reward-card,
body.dark .wp-reward-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #222 100%);
  border-color: rgba(34, 158, 217, 0.3);
}

:root[data-theme="dark"] .wp-reward-title,
[data-theme="dark"] .wp-reward-title,
body.dark .wp-reward-title {
  color: #e8c96a;
}

:root[data-theme="dark"] .wp-reward-subtitle,
[data-theme="dark"] .wp-reward-subtitle,
body.dark .wp-reward-subtitle {
  color: #ccc;
}
