/* ===========================================
   My Task Manager PRO Stylish v3.4 Final
   Randomized Header Color + Image Fix
===========================================*/

/* ===== Layout: Board Containers ===== */
#mtmp-board, .mtmp-admin-board {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: start;
  align-items: flex-start;
  margin: 20px auto;
}

/* ===========================================
   👤 User Columns (Normal Board)
=========================================== */
.mtmp-column {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  min-width: 280px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.mtmp-status-waiting {
  background: rgba(96,165,250,0.15);
  border-left: 4px solid #3b82f6;
}
.mtmp-status-inprogress {
  background: rgba(251,191,36,0.2);
  border-left: 4px solid #eab308;
}
.mtmp-status-done {
  background: rgba(34,197,94,0.2);
  border-left: 4px solid #16a34a;
}

/* عنوان ستون‌ها و Badge رنگی کنار آن */
.mtmp-column h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #0f172a;
  display: flex;
  align-items: center;
}
.mtmp-column h3::before {
  content: '●';
  margin-left: 6px;
  font-size: 0.9rem;
}
.mtmp-status-waiting h3::before { color: #3b82f6; }
.mtmp-status-inprogress h3::before { color: #eab308; }
.mtmp-status-done h3::before { color: #16a34a; }

/* ===========================================
   🔹 Task Boxes
=========================================== */
.mtmp-task-list { display: flex; flex-direction: column; gap: 8px; }

.mtmp-task {
  position: relative;
  overflow: hidden;
  cursor: grab;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}
.mtmp-task:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* عکس داخل کارت */
.mtmp-task img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 8px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mtmp-task img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* دکمه‌های افزودن وظیفه */
.mtmp-add-task {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mtmp-add-task input[type=text],
.mtmp-add-task input[type=file] {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px;
  flex: 1;
}
.mtmp-add-task-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.mtmp-add-task-btn:hover { background: #2563eb; }

/* ===========================================
   👑 Admin Board: Random Color Headers
=========================================== */
.mtmp-admin-board {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}
.mtmp-admin-board::-webkit-scrollbar {
  width: 6px;
}
.mtmp-admin-board::-webkit-scrollbar-thumb {
  background-color: #94a3b8;
  border-radius: 8px;
}

/* کارت هر کاربر */
.mtmp-user-card {
  flex: 1 1 calc(33% - 20px);
  background: linear-gradient(180deg, #fdfdfd 0%, #f9fafb 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mtmp-user-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* سربرگ نام کاربر با رنگ‌های متنوع */
.mtmp-user-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  color: #fff;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* رنگ‌های تصادفی مختلف برای هر کارت */
.mtmp-user-card:nth-child(6n+1) h3 { background: linear-gradient(90deg,#3b82f6,#60a5fa); }
.mtmp-user-card:nth-child(6n+2) h3 { background: linear-gradient(90deg,#16a34a,#22c55e); }
.mtmp-user-card:nth-child(6n+3) h3 { background: linear-gradient(90deg,#eab308,#facc15); }
.mtmp-user-card:nth-child(6n+4) h3 { background: linear-gradient(90deg,#8b5cf6,#a78bfa); }
.mtmp-user-card:nth-child(6n+5) h3 { background: linear-gradient(90deg,#f97316,#fb923c); }
.mtmp-user-card:nth-child(6n+6) h3 { background: linear-gradient(90deg,#ec4899,#f472b6); }

/* ستون‌های داخلی هر کارت کاربر */
.mtmp-user-columns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mtmp-user-columns h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.mtmp-user-columns .mtmp-task-list {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
}

/* افکت Hover روی خود وظایف داخلی کارت */
.mtmp-user-columns .mtmp-task:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
}

/* واکنش‌گرایی */
@media (max-width: 1024px) { .mtmp-user-card { flex: 1 1 calc(50% - 16px); } }
@media (max-width: 700px) { .mtmp-user-card { flex: 1 1 100%; } }

/* فوتر پایین صفحه */
.mtmp-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #475569;
  background: #f8fafc;
  padding: 10px 0;
  border-radius: 8px;
}

/* بهبود دکمه ویرایش و حذف */
.mtmp-edit-task,
.mtmp-delete-task {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-size: 0;
}
.mtmp-edit-task::before {
  content: "✎";
  font-size: 15px;
  color: white;
}
.mtmp-delete-task::before {
  content: "×";
  font-size: 17px;
  color: white;
}
.mtmp-edit-task {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}
.mtmp-edit-task:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}
.mtmp-delete-task {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}
.mtmp-delete-task:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* 🔷 کارت کاربران مدیریتی - نسخه کشویی */
.mtmp-user-card {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all .3s ease;
}

.mtmp-user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  background: #f1f5f9;
  font-weight: 700;
  border-radius: 10px;
}

.mtmp-toggle-user {
  background: none;
  border: none;
  font-size: 18px;
  color: #334155;
}

.mtmp-user-content {
  display: none;
  padding: 10px;
}

.mtmp-user-card.open .mtmp-user-content {
  display: block;
  animation: fadeIn .3s ease;
}

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

/* سایر استایل‌ها و دکمه‌ها از نسخه نهایی v3.4 */
.mtmp-edit-task, .mtmp-delete-task {
  width:30px; height:30px; border-radius:50%;
  display:inline-flex; justify-content:center; align-items:center;
  cursor:pointer; transition:all .25s ease; border:none;
}
.mtmp-edit-task { background: linear-gradient(135deg,#3b82f6,#1d4ed8); color:#fff; }
.mtmp-edit-task:hover { transform:scale(1.15); }
.mtmp-delete-task { background: linear-gradient(135deg,#ef4444,#dc2626); color:#fff; }
.mtmp-delete-task:hover { transform:scale(1.15); }

/* ستون‌های داخلی */
.mtmp-column { border:1px solid #e5e7eb; border-radius:8px; padding:8px; margin-bottom:8px; }
.mtmp-task { background:#fff; border:1px solid #e2e8f0; border-radius:6px; padding:6px; }
.mtmp-task:hover { background:#f1f5f9; border-color:#3b82f6; }

.mtmp-admin-board {
  max-height:calc(100vh - 120px);
  overflow-y:auto;
  padding:10px;
}
.mtmp-task-date {
  display:block;
  margin-top:4px;
  font-size:11px;
  color:#64748b;
}
.mtmp-seen-info {
  font-size: 14px;
  border-left: 4px solid #3b82f6;
}
.mtmp-task.confirmed {
  border: 2px solid #16a34a;
  background: #f0fdf4;
}
/* ✅ حالت وظیفه تأیید‌شده توسط مدیر */
.mtmp-task.confirmed {
  border: 2px solid #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  position: relative;
}
.mtmp-task.confirmed::after {
  content: "✅ تأیید شد";
  position: absolute;
  top: 6px;
  left: 10px; /* ← جابجایی از راست به چپ */
  background: #3aa200;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.mtmp-task.confirmed:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}

.mtmp-task.confirmed .mtmp-task-title::before {
  content: "";
}

/* 🔔 Admin New Tasks Badge */
#mtmp-admin-newtasks-badge {
  position: fixed;
  top: 108px;
  right: 39px;
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(22,163,74,0.25);
  display: none;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s ease;
}
#mtmp-admin-newtasks-badge.pulse {
  animation: pulseBadge 0.7s ease-in-out;
}
@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.mtmp-user-badge {
  display: none;
  position: absolute;
  top: -10px;
  right: -6px;
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.mtmp-user-header {
  position: relative;
}

/* ===========================================
   🟡 Manager Announcement (ابلاغ مدیر)
   My Task Manager PRO — نسخه طلایی نهایی
=========================================== */

#mtmp-latest-announcement {
  display: none;
  margin: 25px auto 20px auto;
  max-width: 720px;
  text-align: center;
  background: linear-gradient(145deg, #fff7c2 0%, #ffeb7e 100%);
  border: 2px solid #facc15;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  padding: 20px 22px;
  color: #78350f;
  font-family: "Vazirmatn", sans-serif;
  animation: fadeIn 0.6s ease-out;
}

.mtmp-ann-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.35rem;
  color: #b45309;
  margin-bottom: 8px;
}

.mtmp-ann-content {
  font-size: 1rem;
  font-weight: 500;
  color: #92400e;
  background: rgba(255,255,255,0.55);
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.8rem;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

.mtmp-ann-meta {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #854d0e;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-weight: 600;
}

.mtmp-ann-meta span {
  background: rgba(255,255,255,0.4);
  padding: 3px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

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

/* ===========================================
   💎 Elegant Urgent Card Theme — MTM PRO v3.6.3
=========================================== */

.mtmp-ann-slide {
  background: radial-gradient(circle at top left, #fff0f0 0%, #ffecec 60%, #ffdcdc 100%);
  border: 2px solid #ff5a5a;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(255,66,66,0.25);
  color: #5b0000;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mtmp-ann-slide:hover {
  transform: scale(1.015);
  box-shadow: 0 12px 28px rgba(255,66,66,0.35);
}

/* عنوان و برچسب‌ها */
.mtmp-ann-slide .font-bold {
  font-family: "Vazirmatn", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #9b1c1c;
  text-shadow: 0 1px 3px rgba(255,255,255,0.7);
}
.mtmp-ann-slide .text-sm {
  color: #7a2a2a;
}

/* دکمه‌ها */
#mtmp-prev, #mtmp-next, #mtmp-close-archive {
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}
#mtmp-prev, #mtmp-next {
  background: linear-gradient(135deg,#ff7b00,#ffa94d);
  color: #fff;
  box-shadow: 0 3px 8px rgba(255,117,0,0.3);
}
#mtmp-prev:hover, #mtmp-next:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 12px rgba(255,117,0,0.45);
}
#mtmp-close-archive {
  background: linear-gradient(135deg,#2563eb,#3b82f6);
  color: #fff;
  box-shadow: 0 3px 8px rgba(37,99,235,0.3);
}
#mtmp-close-archive:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 14px rgba(37,99,235,0.4);
}

/* جداکننده و تاریخ */
.mtmp-ann-slide .border-t {
  border-top: 1px dashed rgba(255,0,0,0.25);
}
.mtmp-ann-slide span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mtmp-ann-slide span::before {
  content: "📅";
  font-size: 0.85rem;
  opacity: 0.8;
}
.mtmp-ann-slide span:nth-child(2)::before {
  content: "🕒";
}

/* افکت نماد بالای کارت */
.mtmp-ann-slide::before {
  content: "⚠️";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.6rem;
  opacity: 0.25;
}
#mtmp-board.mtmp-grid-wrapper {
  display: grid;
  grid-template-columns: 60px 1fr 340px;
  gap: 16px;
  align-items: start;
}

/* ستون‌های داخل main */
.mtmp-board-inner {
  display: flex;
  gap: 16px;
  width: 100%;
}

/* اطمینان از اینکه ستون انجام‌شده همچنان در جریان صفحه است */
.mtmp-status-done { position: relative !important; }

/* ===============================
   🗂 استایل بخش آرشیو وظایف زمان‌بندی
================================== */
.mtmp-archive-box {
  margin-top: 25px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
}
.mtmp-archive-box h4 {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.mtmp-filter-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  margin-left: 5px;
  cursor: pointer;
  transition: 0.2s;
}
.mtmp-filter-btn:hover { background: #1d4ed8; }
.mtmp-filter-btn.active { background: #2563eb; }

#mtmp-archive-list div {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: background 0.25s ease;
}
#mtmp-archive-list div:hover { background: #f1f5f9; }

/* فیلد انتخاب بازه زمان در فرم */
.mtmp-period-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  font-size: 0.9rem;
  color: #334155;
}
.mtmp-period-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
/* هماهنگی فرم */
.mtmp-add-task {
  align-items: center;
  gap: 8px;
}

/* =======================================
   📁 تب‌های آرشیو وظایف – نسخه Soft Cloud
======================================= */
.mtmp-archive-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.mtmp-archive-tab {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  border-radius: 8px;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid #bae6fd;
}

.mtmp-archive-tab:hover {
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 100%);
  color: #0c4a6e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(14,165,233,0.25);
}

.mtmp-archive-tab.active {
  background:#ff00188f;
  color: #ffffff;
  border: 1px solid #c70202;
  box-shadow: 0 2px 10px rgba(14,165,233,0.4);
}

/* برای واکنش‌گرایی */
@media (max-width: 768px) {
  .mtmp-archive-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  .mtmp-archive-tab {
    flex: 1 1 calc(50% - 6px);
  }
}
