/* ======== Global Reset ======== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
  --primary: #87b9b2;     /* رنگ سبز آبی هدر */
  --accent: #35847e;      /* رنگ دکمه‌ها */
  --text-dark: #333;
  --text-light: #555;
  --bg-light: #f7f8fa;
  --white: #fff;
  --border: #ddd;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 8px;
}

/* ======== Base ======== */
body {
  font-family: "Vazirmatn", sans-serif;
  background: var(--bg-light);
  direction: rtl;
  margin: 0;
  padding: 0;
  color: var(--text-dark);
}

/* ======== Header ======== */
header {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  box-shadow: 0 2px 5px var(--shadow);
}

header h1 {
  font-size: 16px;
  margin: 0;
}

header .admin-link {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
header .admin-link:hover {
  background: rgba(255,255,255,0.4);
}

/* ======== Main Card ======== */
.card {
  background: var(--white);
  max-width: 950px;
  margin: 40px auto;
  padding: 28px 36px;
  border-radius: var(--radius);
  box-shadow: 0 4px 8px var(--shadow);
}

/* ======== Fieldset ======== */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  background: var(--white);
}
legend {
  padding: 0 12px;
  font-weight: 600;
  color: var(--text-dark);
}

/* ======== Form Inputs ======== */
label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-light);
  font-size: 14px;
}
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="file"],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
  font-family: inherit;
  font-size: 14px;
  transition: 0.2s;
  margin-bottom: 14px;
  box-sizing: border-box;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(53,132,126,0.15);
}

/* ======== Radio Buttons ======== */
input[type="radio"] {
  margin-left: 6px;
  accent-color: var(--accent);
}

/* ======== Buttons ======== */
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}
button:hover {
  background: #2b6e68;
}

/* ======== Messages ======== */
.success {
  background: #eaf9f2;
  color: #2e7d32;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 20px;
}
.error {
  color: #e63946;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ======== Admin Table ======== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 13.5px;
}
.admin-table th {
  background: var(--accent);
  color: #fff;
  padding: 10px;
}
.admin-table td {
  border-bottom: 1px solid #eee;
  padding: 8px 6px;
}
.admin-table tr:nth-child(even) {
  background: #fafafa;
}

/* ======== Search Box ======== */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-box input[type="text"] {
  flex-grow: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-box a {
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: 0.2s;
}
.search-box a:hover {
  background: #2b6e68;
}
.container {
  width: 90%;
  max-width: 950px;
  margin: 30px auto 50px auto;
  background: #fff;
  padding: 28px 36px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}


/* ===== Buttons inherit Persian font ===== */
button, .search-box a, .admin-link {
  font-family: "Vazirmatn", sans-serif !important;
  letter-spacing: 0;
}

/* ===== Grid Form Layout (2 columns on desktop, 1 on mobile) ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px 24px;
  align-items: end;
}


.form-group {
  display: flex;
  flex-direction: column;
}

/* make radios inline nicely */
.radio-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* unify input heights */
input[type="text"],
input[type="tel"],
input[type="email"],
select,
input[type="file"] {
  height: 42px;
}

/* fieldset spacing */
fieldset legend {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

fieldset {
  margin-bottom: 28px;
  padding: 20px;
}
/* ===== Banner above the container ===== */
.banner {
  width: 90%;
  max-width: 950px;
  margin: 30px auto 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.banner img {
  width: 100%;
  height: auto;
  display: block;
}


.error-box {
  background-color: #fdecea;
  border: 1px solid #f5c2c7;
  color: #b71c1c;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  direction: rtl;
  animation: fadeIn 0.4s ease;
}

.error-box ul {
  margin: 0;
  padding-right: 20px;
}

.error-box li {
  margin-bottom: 4px;
  font-weight: 500;
}

/* برای هماهنگی فیلدهای ورود ادمین */
.container form input[type="text"],
.container form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  direction: rtl;
}

.container form input[type="text"]:focus,
.container form input[type="password"]:focus {
  border-color: #35847e;
  box-shadow: 0 0 4px rgba(53,132,126,0.3);
}

/* ظاهر دکمه‌ها در صفحه لاگین */
.container form button {
  background-color: #35847e;
  color: #fff;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.container form button:hover {
  background-color: #2b6f68;
}

/* نشانگر ماوس برای تصاویر جدول */
.admin-table td img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.admin-table td img:hover {
  transform: scale(1.05);
}

.detail-box {
  position: relative;
}

.detail-toggle {
  cursor: pointer;
  color: #35847e;
  font-weight: 500;
  user-select: none;
  transition: color 0.2s ease;
}

.detail-toggle:hover {
  color: #2b6f68;
}

.detail-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease;
  font-size: 13px;
  text-align: right;
  margin-top: 8px;
}

.detail-content.open {
  opacity: 1;
  max-height: 500px; /* ارتفاع کافی برای محتوا */
}

/* ===== ریسپانسیو برای موبایل ===== */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 16px;
    margin: 15px auto;
    box-shadow: none;
  }

  fieldset {
    padding: 15px;
  }

  legend {
    font-size: 14px;
  }

  button {
    font-size: 15px;
    padding: 10px;
  }

  input, select {
    font-size: 14px;
    height: 40px;
  }

  /* اجبار گرید فرم به تک‌ستونه */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .banner {
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .banner img {
    width: 100%;
    height: auto;
    display: block;
  }
}

/* === ریسپانسیو واقعی برای موبایل و تبلت‌های کوچک (آیفون و اندروید) === */
@media screen and (max-width: 820px) {
  .form-grid {
    display: block !important;
  }

  .form-group {
    width: 100% !important;
    margin-bottom: 14px;
  }

  .container {
    width: 96%;
    padding: 14px;
  }

  fieldset {
    padding: 12px;
  }

  input, select {
    width: 100%;
    display: block;
  }

  legend {
    font-size: 14px;
  }

  button {
    font-size: 15px;
    width: 100%;
  }

  .banner {
    width: 100%;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
  }

  .banner img {
    width: 100%;
    height: auto;
  }
}

/* ===== Footer Section (با رنگ هماهنگ با دکمه ارسال) ===== */
.form-footer {
  text-align: center;
  margin-top: 50px;
  padding: 25px 15px 35px 15px; /* فاصله از بالا و پایین بیشتر */
  background-color: var(--accent); /* رنگ دکمه ثبت فرم */
  border-radius: 0 0 8px 8px; /* گوشه‌های پایین نرم */
  color: #fff; /* متن سفید */
  font-size: 14.5px;
  line-height: 1.9;
}

.footer-phone {
  font-weight: 600;
  font-size: 15.5px;
  color: #fff; /* سفید برای هماهنگی */
}
