﻿/* بک‌گراند کل صفحه - فقط در صفحات افزونه */
.wpa-student-panel-wrapper html,
.wpa-student-panel-wrapper body,
body.wpa-assignment-page {
  background-color: #f5f5f5;
  font-family: var(--wpa-font-family, Vazirmatn, Tahoma, Arial, sans-serif);
}

/* محافظت کلی از استایل‌های قالب - Reset برای المان‌های پنل */
.wpa-student-panel-wrapper,
body.wpa-assignment-page {
  isolation: isolate;
  position: relative;
  /* محافظت کامل از تأثیر قالب روی پنل تکلیف */
  font-family: var(--wpa-font-family, Vazirmatn, Tahoma, Arial, sans-serif) !important;
  color: #000 !important;
  background: #f5f5f5 !important;
}

/* محافظت از المان‌های پنل در برابر استایل‌های قالب */
.wpa-student-panel-wrapper *,
body.wpa-assignment-page * {
  box-sizing: border-box !important;
}

/* جلوگیری از اثر قالب روی لینک‌ها و دکمه‌های پنل */
.wpa-student-panel-wrapper a.wpa-btn-return,
body.wpa-assignment-page a.wpa-btn-return,
.wpa-student-panel-wrapper .wpa-btn-return,
body.wpa-assignment-page .wpa-btn-return {
  font-family: var(--wpa-font-family, Vazirmatn, Tahoma, Arial, sans-serif) !important;
  box-sizing: border-box !important;
}

/* محافظت از المان‌های مهم پنل در برابر استایل‌های قالب */
.wpa-student-panel-wrapper .wpa-card *,
body.wpa-assignment-page .wpa-card * {
  font-family: var(--wpa-font-family, Vazirmatn, Tahoma, Arial, sans-serif) !important;
}

/* جلوگیری از override شدن استایل‌های دکمه توسط قالب */
.wpa-student-panel-wrapper button.wpa-btn-return,
body.wpa-assignment-page button.wpa-btn-return,
.wpa-student-panel-wrapper input[type="button"].wpa-btn-return,
body.wpa-assignment-page input[type="button"].wpa-btn-return {
  all: unset;
  display: inline-flex !important;
}

/* کارت کلی - مدرن و زیبا - محافظت شده از قالب */
.wpa-student-panel-wrapper .wpa-card,
body.wpa-assignment-page .wpa-card,
.wpa-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%) !important;
  border: 2px solid #e0e7ff !important;
  border-radius: 16px !important;
  padding: 24px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08) !important;
  font-size: 16px !important;
  color: #000 !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
}
.wpa-student-panel-wrapper .wpa-card:hover,
body.wpa-assignment-page .wpa-card:hover,
.wpa-card:hover {
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12) !important;
  border-color: #c7d2fe !important;
}

/* کارت جزئیات تکلیف - محافظت شده از قالب */
.wpa-student-panel-wrapper .wpa-card.wpa-detail,
body.wpa-assignment-page .wpa-card.wpa-detail,
.wpa-card.wpa-detail {
  background-color: #fdfdfd !important;
}

/* عنوان‌ها - مدرن - محافظت شده از قالب */
.wpa-student-panel-wrapper .wpa-title,
body.wpa-assignment-page .wpa-title,
.wpa-student-panel-wrapper .wpa-label,
body.wpa-assignment-page .wpa-label,
.wpa-student-panel-wrapper .wpa-subtitle,
body.wpa-assignment-page .wpa-subtitle,
.wpa-title,
.wpa-label,
.wpa-subtitle {
  font-size: 17px !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  margin-bottom: 6px !important;
}
.wpa-student-panel-wrapper .wpa-title,
body.wpa-assignment-page .wpa-title,
.wpa-title { 
  font-size: 28px !important;
  margin-bottom: 20px !important;
  padding-bottom: 12px !important;
  border-bottom: 3px solid !important;
  border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1 !important;
}

/* مقدار داده‌ها */
.wpa-value,
.wpa-desc,
.wpa-deadline {
  font-size: 18px;
  color: #000;
  font-weight: normal;
}

/* وضعیت کلی */
.wpa-status {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  font-weight: bold;
  margin: 6px 0;
  color: #fff;
}

/* وضعیت‌ها رنگی */
.wpa-status.approved { background: #009688; }
.wpa-status.rejected { background: #e53935; }
.wpa-status.pending_review { background: #2196f3; }
.wpa-status.pending_submit,
.wpa-status.pending,
.wpa-status.pending_send { background: #f0ad4e; }

/* جدول تکالیف - استایل مدرن */
.wpa-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}
.wpa-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.wpa-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  padding: 16px 12px;
  text-align: center;
  border: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}
.wpa-table th:first-child {
  border-top-right-radius: 12px;
}
.wpa-table th:last-child {
  border-top-left-radius: 12px;
}
.wpa-table tbody tr {
  background: #fff;
  transition: all 0.3s ease;
  border-bottom: 1px solid #f0f0f0;
}
.wpa-table tbody tr:hover {
  background: #f8f9ff;
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}
.wpa-table tbody tr:last-child td:first-child {
  border-bottom-right-radius: 12px;
}
.wpa-table tbody tr:last-child td:last-child {
  border-bottom-left-radius: 12px;
}
.wpa-table td {
  background: transparent;
  color: #374151;
  padding: 16px 12px;
  text-align: center;
  border: none;
  font-size: 14px;
  vertical-align: middle;
}
.wpa-table td a {
  text-align: center;
}
.wpa-table tbody tr:nth-child(even) {
  background: #fafbff;
}
.wpa-table tbody tr:nth-child(even):hover {
  background: #f0f4ff;
}
.wpa-table .wpa-status {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  color: #fff;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}
.wpa-table .wpa-status:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* فایل‌ها */
.wpa-file-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.wpa-file-card {
  background: #fdfdfd;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  width: 150px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.wpa-thumb {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}
.wpa-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.wpa-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.wpa-thumb:hover img {
  transform: scale(1.05);
}
.wpa-thumb::after {
  content: '👁️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.wpa-thumb:hover::after {
  opacity: 1;
}

/* کارت فایل PDF: نارنجی فقط روی آیکون */
.wpa-pdf-icon {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255,152,0,0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}
.wpa-pdf-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255,152,0,0.4);
}
.wpa-pdf-icon img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  background: none;
}
.wpa-pdf-icon span {
  background: #ff9800;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: bold;
}

/* دکمه‌ها */
.wpa-btn-xs,
.wpa-btn-view {
  font-size: 12px;
  padding: 2px 10px;
  width: 90px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
  text-align: center;
}

/* رنگ دکمه‌ها */
.wpa-btn-teal { background: #009688; color: #fff; }
.wpa-btn-red  { background: #e53935; color: #fff; }

/* دکمه مشاهده تکلیف – مدرن و زیبا */
.wpa-btn-view {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
  text-align: center;
  display: inline-block;
  width: auto;
  min-width: 120px;
  max-width: 150px;
}
.wpa-btn-view:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}
.wpa-btn-view:active {
  transform: translateY(0);
}

/* دکمه بازگشت به پنل - محافظت شده از قالب */
.wpa-student-panel-wrapper .wpa-btn-return,
body.wpa-assignment-page .wpa-btn-return,
.wpa-btn-return {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #fff !important;
  padding: 12px 24px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  min-width: 140px !important;
  text-align: center !important;
  font-family: var(--wpa-font-family, Vazirmatn, Tahoma, Arial, sans-serif) !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}
.wpa-student-panel-wrapper .wpa-btn-return:hover,
body.wpa-assignment-page .wpa-btn-return:hover,
.wpa-btn-return:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
  transform: translateY(-2px) !important;
  color: #fff !important;
  text-decoration: none !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.wpa-student-panel-wrapper .wpa-btn-return:active,
body.wpa-assignment-page .wpa-btn-return:active,
.wpa-btn-return:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
}
.wpa-student-panel-wrapper .wpa-btn-return:focus,
body.wpa-assignment-page .wpa-btn-return:focus,
.wpa-btn-return:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3) !important;
}

/* دکمه‌های فایل‌ها باریک‌تر */
.wpa-actions .wpa-btn-xs {
  font-size: 12px;
  padding: 2px 6px;
  width: 70px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
  text-align: center;
}

/* دکمه مشاهده فایل‌ها – آبی */
.wpa-actions .wpa-btn-xs.wpa-btn-teal {
  background: #2196f3;
  color: #fff;
}
.wpa-actions .wpa-btn-xs.wpa-btn-teal:hover {
  background: #1976d2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

/* دکمه حذف فایل‌ها – قرمز */
.wpa-actions .wpa-btn-xs.wpa-btn-red {
  background: #e53935;
  color: #fff;
}
.wpa-actions .wpa-btn-xs.wpa-btn-red:hover {
  background: #c62828;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

/* دکمه‌ها زیر هم */
.wpa-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

/* پیام‌ها */
.wpa-alert {
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 14px;
}
.wpa-alert-red  { background: #ffebee; color: #c62828; }
.wpa-alert-blue { background: #f5f5f5; color: #006064; }
.wpa-muted { color: #777; font-size: 13px; }

/* عنوان بخش‌ها */
.wpa-card h3 {
  font-size: 18px;
  margin: 30px 0 12px;
}

/* Dropzone */
#wpa-dropzone {
  border: 2px dashed #009688;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: #00796b;
  cursor: pointer;
  margin-top: 30px;
}
.wpa-dropzone.drag {
  background: #f5f5f5;
  border-color: #00796b;
}

/* Progress */
#wpa-upload-progress { margin-top: 14px; }
.wpa-progress-item {
  margin-top: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
}
.wpa-progress-bar {
  height: 8px;
  background: #009688;
  width: 0%;
  transition: width 0.3s ease;
}

/* مودال کلی */
.wpa-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}
.wpa-modal-content {
  background: #fdfdfd;
  border-radius: 10px;
  max-width: 95vw;
  width: 900px;
  max-height: 90vh;
  padding: 20px;
  position: relative;
  box-sizing: border-box;
}
.wpa-close {
  position: absolute;
  right: 12px; top: 12px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}
.wpa-close:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

/* بهبود responsive */
@media (max-width: 768px) {
  .wpa-card {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  /* استایل دکمه بازگشت در موبایل */
  .wpa-card .wpa-btn-view {
    width: 100%;
    margin-top: 10px;
    text-align: center;
  }
  
  /* مخفی کردن جدول در موبایل */
  .wpa-table-desktop {
    display: none;
  }
  
  /* نمایش کارت‌ها در موبایل */
  .wpa-cards-mobile {
    display: block;
  }
  
  /* استایل کارت تکلیف در موبایل - مدرن و زیبا */
  .wpa-assignment-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }
  
  .wpa-assignment-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
  }
  
  .wpa-assignment-card:hover {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
    border-color: #667eea;
  }
  
  .wpa-assignment-card:hover::before {
    width: 6px;
  }
  
  .wpa-card-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e7ff;
    position: relative;
  }
  
  .wpa-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.5;
    padding-right: 0.5rem;
  }
  
  .wpa-card-body {
    margin-bottom: 1.25rem;
  }
  
  .wpa-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e7ff;
    transition: background 0.2s ease;
  }
  
  .wpa-card-row:hover {
    background: rgba(102, 126, 234, 0.05);
    padding-right: 0.5rem;
    border-radius: 8px;
  }
  
  .wpa-card-row:last-child {
    border-bottom: none;
  }
  
  .wpa-card-label {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 100px;
    display: flex;
    align-items: center;
  }
  
  .wpa-card-label::before {
    content: '▸';
    color: #667eea;
    margin-left: 0.5rem;
    font-size: 0.8rem;
  }
  
  .wpa-card-value {
    color: #374151;
    font-size: 0.95rem;
    text-align: left;
    flex: 1;
    font-weight: 500;
  }
  
  .wpa-card-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid #e0e7ff;
  }
  
  .wpa-btn-full {
    width: 100%;
    display: block;
    text-align: center;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border: none;
  }
  
  .wpa-btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  }
  
  .wpa-btn-full:active {
    transform: translateY(0);
  }
  
  .wpa-table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .wpa-table th,
  .wpa-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }
  
  .wpa-file-grid {
    gap: 12px;
  }
  
  .wpa-file-card {
    width: 120px;
    padding: 8px;
  }
  
  .wpa-thumb {
    height: 80px;
  }
  
  .wpa-thumb::after {
    font-size: 14px;
    padding: 4px 8px;
  }
  
  .wpa-modal-content {
    width: 98vw;
    max-height: 95vh;
    padding: 15px;
  }
  
  .wpa-title {
    font-size: 22px;
  }
  
  .wpa-value,
  .wpa-desc {
    font-size: 16px;
  }
  
  #wpa-dropzone {
    padding: 15px;
    font-size: 14px;
  }
  
  .wpa-actions {
    gap: 8px;
  }
  
  .wpa-actions .wpa-btn-xs {
    width: 100%;
    padding: 6px;
  }
}

@media (max-width: 480px) {
  .wpa-card {
    padding: 12px;
  }
  
  .wpa-title {
    font-size: 20px;
  }
  
  .wpa-table {
    font-size: 12px;
  }
  
  .wpa-file-card {
    width: 100px;
  }
  
  .wpa-thumb {
    height: 70px;
  }
}

/* نمایش جدول در دسکتاپ و مخفی کردن کارت‌ها */
@media (min-width: 769px) {
  .wpa-table-desktop {
    display: block;
  }
  
  .wpa-cards-mobile {
    display: none;
  }
}

/* بهبود hover effects */
.wpa-file-card {
  transition: all 0.3s ease;
}
.wpa-file-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: #009688;
}

/* بهبود دکمه‌ها */
.wpa-btn-view,
.wpa-btn-xs {
  transition: all 0.2s ease;
}
.wpa-btn-view:active,
.wpa-btn-xs:active {
  transform: translateY(0);
}

/* بهبود جدول - حذف شده چون در استایل جدید اضافه شده */

/* بهبود dropzone */
#wpa-dropzone {
  transition: all 0.3s ease;
  background: #fafafa;
}
#wpa-dropzone:hover {
  background: #f0f0f0;
  border-color: #00796b;
}
.wpa-dropzone.drag {
  background: #e0f2f1;
  border-color: #009688;
  transform: scale(1.02);
}

/* بهبود progress */
.wpa-progress-item {
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
}
.wpa-progress-item:first-child {
  margin-top: 0;
}

/* بهبود spacing */
.wpa-row {
  margin-bottom: 15px;
}
.wpa-row:last-child {
  margin-bottom: 0;
}

/* بهبود modal iframe */
.wpa-modal-content iframe {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* بهبود alert */
.wpa-alert {
  padding: 12px 16px;
  line-height: 1.6;
}
.wpa-alert-blue {
  border-right: 4px solid #0288d1;
}
.wpa-alert-red {
  border-right: 4px solid #c62828;
}

/* بهبود status badges */
.wpa-status {
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.wpa-status:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}