@font-face {
    font-family: 'Yekan';
    src: url('fonts/Yekan.woff') format('woff'),
         url('fonts/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Yekan', sans-serif;
    direction: rtl;
    background: #f4f6f9;
    margin: 0;
    padding: 0;
}



.tab-buttons {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.tab-btn {
    background: #aaaaaa;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    margin: 0 3px;
    transition: 0.3s;
}
.tab-btn.active {
    background: #fbc02d;
    color: #000;
}
.tab-content {
    display: none;
    background: #fff;
    padding: 20px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.tab-content.active {
    display: block;
}
.edit-btn {
    background: #ffeb3b; /* زرد برای ویرایش */
    color: #000;
}
.delete-btn {
    background: #f44336; /* قرمز برای حذف */
    color: #fff;
}
.action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
}
.table-view table {
    width: 100%;
    border-collapse: collapse;
}
.table-view th, .table-view td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
}
.table-view th {
    background: #f1f1f1;
    cursor: pointer;
}



/* ------------------- جدول دسکتاپ ------------------- */
.table-view {
    max-height: 500px;       /* اسکرول فعال */
    overflow-y: auto;
    overflow-x: hidden;
}

.table-view table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 12px;
}

/* ----------- هدر ثابت هنگام اسکرول (Sticky Header) ----------- */
.table-view thead th {
    position: sticky;
    top: 0;
    background: #007bff !important;
    color: #fff;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.table-view th, .table-view td {
    padding: 12px;
    text-align: center;
}
.table-view th {
    background: #007bff;
    color: #fff;
    cursor: pointer;
}
.table-view tr:nth-child(even) {
    background: #f7f9fc;
}




.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
}
.header-bar h3 {
    margin: 0;
}





.container {
    max-width: 95%;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

input, select, button, textarea {
    width: 100%;
    padding: 12px;
   // margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
    font-family: 'Yekan', sans-serif;
    direction: rtl;
}

button {
    background: #4CAF50;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border: none;
}
button:hover {
    background: #45a049;
}

.radio-group {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}
.radio-group label {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin: 4px 0;
    cursor: pointer;
    font-size: 16px;
}
.radio-group input {
    display: none;
}
.radio-group input:checked + label {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
table th, table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
table th {
    position: sticky;
    top: 0;
    background: #007bff;
    color: #99999;
    font-weight: bold;
    cursor: pointer;
}
table tr:nth-child(even) {
    background: #f9f9f9;
}

.action-btn {
    display: inline-block;
    padding: 6px 14px;   /* ارتفاع کمتر */
    font-size: 14px;     /* فونت کوچکتر */
    border-radius: 6px;
    margin: 2px;
    white-space: nowrap; /* جلوگیری از رفتن به خط بعد */
    text-decoration: none;
    transition: 0.2s;
}

@media (max-width: 480px) {
    .action-btn {
        white-space: normal; /* wrap می‌شود */
        text-align: center; /* متن وسط‌چین بشه قشنگ‌تره */
    }
}




.edit-btn {
    background: #ffc107;
    color: #000;
}
.edit-btn:hover {
    background: #e0a800;
}
.delete-btn {
    background: #dc3545;
    color: #fff;
}
.delete-btn:hover {
    background: #c82333;
}

a.delete {
  
    background: #dc3545 !important;
    color: #fff;
    display: inline-block;
    padding: 6px 14px;   /* ارتفاع کمتر */
    font-size: 14px;     /* فونت کوچکتر */
    border-radius: 6px;
    margin: 2px;
    white-space: nowrap; /* جلوگیری از رفتن به خط بعد */
    text-decoration: none;
    transition: 0.2s;
cursor: pointer;
color: #fff !important;
}
a.delete:hover {
    background: #c82333 !important;
cursor: pointer;
}



a.editEventBtn {
    background: #ffc107 !important;
    color: #000;
    display: inline-block;
    padding: 6px 14px;   /* ارتفاع کمتر */
    font-size: 14px;     /* فونت کوچکتر */
    border-radius: 6px;
    margin: 2px;
    white-space: nowrap; /* جلوگیری از رفتن به خط بعد */
    text-decoration: none;
    transition: 0.2s;
cursor: pointer;
}
a.editEventBtn:hover {
    background: #e0a800 !important;
cursor: pointer;
}


@media (max-width: 480px) {
    .delete {
        white-space: normal; /* wrap می‌شود */
        text-align: center; /* متن وسط‌چین بشه قشنگ‌تره */
    }
} 
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.modal {
  display: none;               /* پنهان پیش‌فرض */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow-y: auto;            /* اسکرول فعال برای موبایل و دسکتاپ */
  justify-content: center;
  padding: 20px;               /* فاصله بالا/پایین برای موبایل */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;      /* جلوگیری از مشکلات Flex در موبایل */
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  max-height: calc(100vh - 40px); /* ارتفاع کمتر از کل viewport */
  overflow-y: auto;            /* اسکرول داخلی */
  width: 100%;
  max-width: 600px;
  position: relative;
  margin: auto 0;              /* وسط‌چین عمودی */
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: red;
  color: black;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  z-index: 1001;
}

.close-btn:hover {
  background-color: darkred;
}

.modal-content h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

/* ریسپانسیو موبایل */
@media (max-width: 480px) {
  .modal-content {
    max-height: calc(100vh - 30px);
    padding: 15px;
  }

  .close-btn {
    padding: 6px 12px;
    font-size: 14px;
  }
}


.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.form-group { flex:1; min-width:120px; display:flex; flex-direction:column; }
label { margin-bottom:5px; font-weight:bold; }
input, select, textarea { padding:8px; border-radius:5px; border:1px solid #ccc; }
textarea { resize: vertical; }
button { padding:10px 20px; border:none; border-radius:5px; cursor:pointer; }
.btn.cancel-btn { background-color:#ccc; color:#000; }
.btn { background-color:#007bff; color:#fff; }

/* تاگل سوئیچ */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { display:none; }
.slider { position: absolute; cursor: pointer; top:0; left:0; right:0; bottom:0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }




/* فقط در دسکتاپ جدول نمایش داده شود */
.table-view {
    display: block;
}

.card-view {
    display: none;
}

/* فقط در موبایل کارت‌ها نمایش داده شوند */
@media (max-width: 768px) {
    .table-view {
        display: none;
    }
    .card-view {
        display: block;
    }

    .card {
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 15px;
        background: #fff;
        box-shadow: 0 3px 8px rgba(0,0,0,0.15);
        font-size: 16px; /* فونت بزرگ‌تر */
    }

    .card strong {
        display: block;
        margin-bottom: 6px;
        color: #333;
    }


    .event-yes {
	/* box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4) !important; /* سبز */
       background-color: #d4fcd4 !important; /*  سبز کمرنگ */
    }
    .event-no {
       /* box-shadow: 0 4px 10px rgba(244, 67, 54, 0.4) !important; /* قرمز */
        background-color: #ffe0e6 !important; /* صورتی کمرنگ */
    }


tr.event-yes {
    background-color: #d4fcd4 !important; /* سبز روشن برای انجام‌شده */
}


tr.event-no {
    background-color: #ffe0e6 !important; /* قرمز خیلی روشن برای لغوشده */
}

    .card p {
        white-space: normal !important; /* اجازه رفتن به خط بعد */
        word-wrap: break-word; /* در صورت نیاز کلمه بشکنه */
        overflow: visible !important;
        text-overflow: unset !important; 
    }


}


/* جلوگیری از تأثیر رنگ سطر روی دکمه‌ها بدون حذف رنگ دکمه‌ها */
.event-yes a:not(.editEventBtn):not(.delete),
.event-no a:not(.editEventBtn):not(.delete) {
  color: inherit;
  background: none;
}


/* فقط دسکتاپ */
@media (min-width: 769px) {
    .event-yes {
        border-right: 6px solid #4CAF50; /* سبز */
    }
    .event-no {
        border-right: 6px solid #f44336; /* قرمز/صورتی */
    }
}





.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 26px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(24px);
}


/* کارت موبایل: لیبل و مقدار در یک خط، جلوگیری از شکستن خط */
.card-view .card p {
  margin: 6px 0;
  line-height: 1.3;
  
  direction: rtl;
}

/* لیبل قوی (مثل "استان:") کنار مقدار در یک خط */
.card-view .card p strong {
  display: inline-block;
  min-width: 67px; /* تنظیم طول لیبل دلخواه */
  margin-left: 8px;
  font-weight: 700;
}

/* کارت استایل موبایل کمی بزرگ‌تر */
@media (max-width: 768px) {
  .card-view .card {
    font-size: 16px;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    background: #fff;
  }
}

/* مرتب سازی: علامت صعود/نزول */
th.sortable { cursor: pointer; position: relative; }
th.sortable.asc::after { content: " ▲"; }
th.sortable.desc::after { content: " ▼"; }

/* کوچک کردن جدول روی موبایل (در صورت نیاز اسکرول) */
.table-view { overflow-x:auto; }

/* مودال (در صورت نداشتن در style.css) */
.modal { position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; justify-content:center; align-items:center; }
.modal-content { background:#fff; padding:18px; border-radius:12px; width:92%; max-width:420px; box-shadow:0 6px 20px rgba(0,0,0,0.25); text-align:right; direction:rtl; }
.modal .close { position:absolute; top:10px; right:16px; font-size:22px; cursor:pointer; color:#666; }


.popup-message {
    position: fixed;
    top: 25px;
    right: 25px;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: 'Yekan', sans-serif;
    font-size: 15px;
    color: #fff;
    background: #4caf50;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}
.popup-message.show {
    opacity: 1;
    transform: translateY(0);
}
.popup-message.error { background: #f44336; }

tr.event-yes {
    background-color: #d4fcd4 !important; /* سبز روشن */
}

tr.event-no {
    background-color: #ffe0e6 !important; /* قرمز روشن */
}





/* بخش شناور بالا */
.top-bar {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    direction: rtl;
}

/* کانتینر دکمه‌ها */
.button-group {
    display: flex;
 //   flex-wrap: wrap; 
    gap: 10px;
    align-items: center;
}

/* استایل پایه دکمه */
.button-group button {
    font-family: 'Yekan', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #2d89ef;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 15px;
    transition: 0.2s;
}

.button-group button:hover {
  transform: translateY(-2px);
}

/* دکمه‌های اکشن */
.action-btn {
  background: #00b894;
}

.action-btn:hover {
  background: #019870;
}

/* دکمه حذف */
.delete-btn {
  background: #d63031;
}

.delete-btn:hover {
  background: #b02021;
}

/* ============ موبایل ============ */
@media (max-width: 800px) {
    .button-group {
        justify-content: space-between;
    }
    .button-group button {
        flex: 1 1 48%;
        justify-content: center;
        padding: 10px;
        font-size: 0;
    }
    .button-group button span {
        display: none;
    }
    .button-group button i {
        font-size: 22px;
    }
}


/* آمار */
.stats-container {
    display: flex;
    flex-wrap: wrap; /* اجازه می‌دهد آیتم‌ها به خط بعد بروند اگر جا کم باشد */
    justify-content: space-around; /* فاصله مناسب بین آیتم‌ها */
    background: #f0f8ff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    font-family: 'Yekan', sans-serif;
}

.stat-item {
    margin: 5px 10px;
    flex: 1 1 20px; /* حداقل عرض 20px و اجازه رشد */
}

/* موبایل: زیر هم */
@media (max-width: 768px) {
    .stats-container {
        flex-direction: column;
        align-items: center;
    }
    .stat-item {
        width: 100%;
        margin: 5px 0;
    }
}





/* --- فیلتر بالای جدول --- */
.filter-wrapper {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    padding: 10px 0;
}

.filter-form { 
    margin-bottom:15px; 
    display:flex; 
    gap:10px; 
    align-items:center;
   //flex-wrap: wrap;
}

.filter-form select, 
.filter-form input { 
    padding:6px 10px; 
    border-radius:5px;
    border:1px solid #ccc;
    font-size:14px;
    font-family: 'Yekan', Tahoma, sans-serif;
}

th { 
    
    
    position: sticky;
    top: 0;
    z-index: 100;
    padding:8px;
}

tr:hover { background:#eee; }

/* دسکتاپ: جدول نمایش داده شود */
.logs-table-wrapper {
    display: block;
    overflow-x: auto;
}

.logs-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.logs-table-wrapper th, .logs-table-wrapper td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.logs-table-wrapper th {
    background: #f7f7f7;
    font-weight: bold;
}

/* کارت موبایل: پنهان در دسکتاپ */
.logs-card-wrapper {
    display: none;
}

/* موبایل: جدول پنهان، کارت نمایش داده شود */
@media (max-width: 768px) {
    .logs-table-wrapper {
        display: none !important;
    }
    .logs-card-wrapper {
        display: block !important;
    }
    .log-card {
        background: #fff;
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        font-size: 16px;
    }
    .log-card div {
        margin-bottom: 6px;
    }
    .log-card strong {
        display: inline-block;
        min-width: 70px;
    }
}



/* ======================= پاپ آپ تأیید ======================= */

.popup-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Yekan';
    z-index: 9999;
    display: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.popup-error {
    background: #e74c3c !important;
}