

@font-face {
  font-family: 'B Nazanin';
  src: url('/fonts/B-Nazanin.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}


:root {
    --bs-body-bg: #ffffff;
}
html{
      background: url('uploads/background-islamic-vector-svg-outline.svg') repeat;
  background-size: 70px 70px;
  direction: rtl;
  background-attachment: fixed;

}

body {
  margin: 0;
  font-family: 'B Nazanin', Tahoma, sans-serif;

}
body.login-page {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: center;
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to right, #f0f4f3, #d9f0e4);
}

.login-box {
    background: #ffffff;
    padding: 50px;
    width: 60%;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.login-box:hover {
    transform: scale(1.02);
}

.login-box h2 {
    margin-bottom: 30px;
    color: #276749;
    font-size: 32px;
}

.login-box input {
    width: 100%;
    margin: 10px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: #276749;
    outline: none;
}

.login-box button {
    width: 100%;
    padding: 15px;
    background: #276749;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: #1f4e40;
}

.error {
    color: red;
    margin-bottom: 15px;
    font-size: 14px;
}


/* Header */
header {
    background: url(uploads/backindex.webp);
    color: #689574;
    text-align: center;
    background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  padding-top: 50px;
}

header input {
  width: 70%;
  padding: 10px;
  margin-top: 15px;
  border-radius: 8px;
  border: 1px solid #1f4e40;
  outline: none;
  transition: all 0.3s ease;
}

header input:focus {
    border-color: #276749;
    box-shadow: 0 0 5px rgba(39, 103, 73, 0.8);
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
}


/* لیست محصولات - Flex برای ردیف‌ها در دسکتاپ */
#productList {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  padding: 15px;
}


/* کارت محصول */
.product-card {
  display: flex;
  align-items: center;
  background: url(uploads/depositphotos_100946086-stock-illustration-vector-seamless-pattern-with-art.webp);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  padding: 20px 80px 20px;
  gap: 20px;
  justify-content: space-between;
  transition: transform 0.3s, box-shadow 0.3s ease-in-out;
  flex-direction: row;
  flex-grow: 1;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  width:20%;
}

/* عکس محصول */
.product-card img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.product-card img:hover {
  transform: scale(1.1);
}

/* اطلاعات محصول */
.product-card .product-info {
  flex: 1;
}

.product-card h3 {
  margin: 0;
  font-size: 20px;
  color: #276749;
}
.product-card p {
  color: #555;
  font-size: 18px;
  margin: 10px 0;
}

/* دکمه ویرایش */
.product-card a {
  text-decoration: none;
  background-color: #689574;
  color: white;
  font-size: 15px;
  padding: 10px 25px;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.2s ease-in-out;
}
.product-card a:hover {
  background-color: #1f4e40;
  transform: translateY(-3px);
}

/* افکت هاور */
.product-card:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}


/* Lightbox for Image */
#lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
#lightbox-img {
    width: 100%;
    max-width: 70%;
    height: auto;
    border-radius: 8px;
}

.logout {
  background-color: #9ab9ac;
  color: white;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  width: 30%;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s forwards;
  margin: 10px auto;
  display: block;
  position: relative;
}


/* انیمیشن ظاهر شدن */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تاخیر زمانی برای هر دکمه */
.logout:nth-child(1) { animation-delay: 0.1s; }
.logout:nth-child(2) { animation-delay: 0.25s; }
.logout:nth-child(3) { animation-delay: 0.4s; }
.logout:nth-child(4) { animation-delay: 0.55s; }
.logout:nth-child(5) { animation-delay: 0.7s; }
.logout:nth-child(6) { animation-delay: 0.85s; }
.logout:nth-child(7) { animation-delay: 1s; }
.logout:nth-child(8) { animation-delay: 1.15s; }
.logout:nth-child(9) { animation-delay: 1.30s; }
.logout:nth-child(10) { animation-delay: 1.45s; }
.logout:nth-child(11) { animation-delay: 1.60s; }


.logout a {
  text-decoration: none;
  color: white;
}

.logout:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* استایل دکمه "افزودن محصول جدید" */
.add-button {
    background-color: #276749;
    color: white;
    padding: 13px 30px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.add-button:hover {
    background-color: #1f4e40;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* استایل مودال (پنجره افزودن محصول جدید) */
#addModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: white;
    padding: 50px;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    animation: modal-in 0.5s ease-in-out;
}

.modal-content h2 {
    color: #276749;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.modal-content button {
    background-color: #276749;
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.modal-content button:hover {
    background-color: #1f4e40;
}
.suggestions-box {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    direction: rtl;
    font-size: 0.9rem;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.suggestions-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.suggestions-box li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions-box li:hover {
    background-color: #f9f9f9;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 70px;
  color: #fff;
  cursor: pointer;
}

/* انیمیشن مودال */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.close:hover {
    color: #1f4e40;
}


/*start edit.php*/
.edit-box {
  max-width: 1000px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  font-family: 'IRANSans', sans-serif;
  direction: rtl;
}

.edit-box h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.edit-box h2 i {
  margin-left: 8px;
  color: #007bff;
}

/* --- ساختار دو ستونه --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- استایل فیلدها --- */
.form-group label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
  color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 14px;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #007bff;
  box-shadow: 0 0 8px rgba(0,123,255,0.2);
  outline: none;
}

/* فیلدهای کنار هم */
.inline-fields {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* --- گالری تصاویر --- */
.current-image img {
  max-width: 150px;
  border-radius: 15px;
  border: 3px solid #eee;
  transition: transform 0.3s;
}

.current-image img:hover {
  transform: scale(1.05);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.gallery-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s;
}

.gallery-item:hover {
  border-color: #007bff;
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- دکمه‌ها --- */
.buttons {
  margin-top: 30px;
  display: flex;
  justify-content: flex-start;
  gap: 15px;
}

.save-btn, .delete-btn, .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-decoration: none;
}

.save-btn {
  background: #28a745;
  color: #fff;
}

.save-btn:hover { background: #218838; }

.delete-btn {
  background: #dc3545;
  color: #fff;
}

.delete-btn:hover { background: #c82333; }

.back-link {
  background: #6c757d;
  color: #fff;
}

.back-link:hover { background: #5a6268; }

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .product-card {
      width:100%;
  }
}

/*end edit.php*/


/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    text-align: right;
}

table th, table td {
    border: 1px solid #ccc;
    padding: 12px;
    vertical-align: top;
}

table th {
    background-color: #276749;
    color: white;
    font-size: 1.1rem;
}

table td {
    color: #555;
    font-size: 1rem;
}



.image-source-options {
    display: flex;
    gap: 15px;
    margin: 10px 0;
}
.image-source-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: 0.3s;
    width:100%;
    font-size: 10px;
}
.image-source-options input[type="radio"] {
    accent-color: #007bff;
}


.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f0f0f0;
    justify-content: flex-start;
}

.gallery-item {
    border: 2px solid transparent;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item.selected {
    border: 2px solid #007bff;
    background-color: #eaf4ff;
}

.gallery-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.delete-btn{
    background:#ff4141 !important;
}

.filter-sort-bar {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    padding: 10px 30px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
    width:40%;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

.filter-group select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}


.tag-container {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: absolute;
      top:12px;
      left: 0;
      transform: rotate(-30deg);
}

.tag-badge {
    background: #e0f0ff;
    color: #007bff;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #cce5ff;
    transition: background 0.3s;
}

.tag-badge:hover {
    background: #d0eaff;
    cursor: default;
}
.product-actions{
  display:flex;
  justify-content: space-between;
  margin-top:5px;
}

.badge {
  background: white;
  color: #2e3d35;
  padding: 4px 9px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease-in-out;
  margin-right: 4px;
}

.logout:hover .badge {
  background: #2e3d35;
  color: #fff;
  transform: scale(1.1);
}