/* =========================
   Base layout + Typography
   ========================= */

@font-face {
  font-family: 'Vazir';
  /* adjust path if your fonts are elsewhere; assuming: static/fonts/... */
  src: url('../fonts/Vazir-Medium.woff2') format('woff2'),
       url('../fonts/Vazir-Medium.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Vazir';
  src: url('../fonts/Vazir-Bold.woff2') format('woff2'),
       url('../fonts/Vazir-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

body {
  margin: 0;
  font-family: 'Vazir', "Segoe UI", Roboto, sans-serif;
  background-color: #e5e4e2;   /* soft light background */
  color: #1c2a49;              /* deep navy text */
  line-height: 1.7;
  direction: rtl;
}

p {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  text-align: center;
  color: #000;
}

/* =========================
   HEADER section
   ========================= */

.header {
  padding: 0.75rem 1rem;
  text-align: center;
  background: linear-gradient(90deg, #e5e4e2 0%, #f4f3f0 40%, #e5e4e2 100%);
  border-bottom: 2px solid #c9c7c2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.header h3 {
  margin: 0;
  font-size: 1.6rem;
  color: #000;
  font-weight: 700;
}

.header a {
  color: #1c2a49;
  text-decoration: none;
  font-weight: 600;
}

.header a:hover {
  text-decoration: underline;
}

/* =========================
   MAIN content container
   ========================= */

.container {
  font-family: 'Vazir', "Segoe UI", Roboto, sans-serif;
  padding: 2.5rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Headings */

h4 {
  margin-top: 2rem;
  font-size: 1.2rem;
  color: #1c2a49;
  border-right: 4px solid #1c2a49;
  padding-right: 10px;
  margin-right: 0;
}

/* =========================
   Table styles
   ========================= */

table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  background-color: #f7f7fa;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

th,
td {
  padding: 0.9rem 0.75rem;
  font-size: 0.95rem;
  text-align: center;
}

th {
  background: linear-gradient(90deg, #1c2a49, #2f3d70);
  color: #fdfdfd;
  font-weight: 600;
  border-bottom: 1px solid #d3d1cb;
}

td {
  background-color: #ffffff;
  color: #1c2a49;
  border-bottom: 1px solid #e3e1dc;
}

tr:nth-child(even) td {
  background-color: #f1f0ed;
}

tr:last-child td {
  border-bottom: none;
}

.weighted {
  color: #2f7b3b;
  font-weight: 700;
}

/* =========================
   Inputs & Forms
   ========================= */

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c4c2bd;
  border-radius: 6px;
  background-color: #f9f8f6;
  color: #1c2a49;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #1c2a49;
  box-shadow: 0 0 0 3px rgba(28, 42, 73, 0.15);
  background-color: #ffffff;
}

form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: #353e68;
  text-align: right;
}

form input[type="text"] {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background-color: #f9f8f6;
  color: #1c2a49;
  box-sizing: border-box;
}

/* Form groups */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #303959;
}

/* Unified form fields */

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #cbc9c4;
  background-color: #f9f8f6;
  color: #1c2a49;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1c2a49;
  box-shadow: 0 0 0 3px rgba(28, 42, 73, 0.15);
  background-color: #ffffff;
}

/* =========================
   Buttons
   ========================= */

button {
  background: linear-gradient(135deg, #1c2a49, #2f3d70);
  color: #fff;
  padding: 0.55rem 1.4rem;
  margin: 6px 4px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
  background: linear-gradient(135deg, #283764, #405088);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-link {
  display: inline-block;
  padding: 0.45rem 1rem;
  background-color: #e5e4e2;
  color: #1c2a49;
  border: 1px solid #c2c0ba;
  border-radius: 999px;
  text-decoration: none;
  margin-right: 8px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-link:hover {
  background-color: #d5d4cf;
  color: #1c2a49;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Semantic button classes if you use them */

.btn {
  background: linear-gradient(135deg, #1c2a49, #2f3d70);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  display: inline-block;
  margin: 0.5rem 0;
  font-weight: 600;
  border: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  background: linear-gradient(135deg, #283764, #405088);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #c7c5bf;
  color: #1c2a49;
}

.btn-secondary:hover {
  background: #b6b4ae;
}

/* =========================
   Navbar styles
   ========================= */

.navbar {
  background: linear-gradient(90deg, #1c2a49, #31406b);
  padding: 0.7rem 2rem;
  border-bottom: 1px solid #141b33;
  margin-bottom: 1.5rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-left,
.navbar-center,
.navbar-right {
  display: flex;
  align-items: center;
}

/* Left & right keep natural width */
.navbar-left,
.navbar-right {
  flex: 0 0 auto;
}

/* Center grows and centers its items */
.navbar-center {
  flex: 1;
  justify-content: center;
  gap: 1rem;
}

.nav-link {
  color: #f0f1f5;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background-color: rgba(229, 228, 226, 0.25);
  color: #ffffff;
}

/* =========================
   Card style (light theme)
   ========================= */

.dark-card {
  background-color: #f7f7fa;
  color: #1c2a49;
  border-radius: 12px;
  padding: 1.8rem;
  margin: 2rem auto;
  max-width: 540px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid #dddbd6;
}

/* =========================
   Error message styling
   ========================= */

.error {
  color: #c0392b;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background-color: #fdecea;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  border: 1px solid #f5c6cb;
}

/* =========================
   Responsive layout
   ========================= */

@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 1rem;
    border: 1px solid #d4d2cd;
    border-radius: 10px;
    padding: 0.6rem 0.5rem;
    background: #f7f7fa;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  }

  td {
    position: relative;
    padding-left: 50%;
    padding-right: 0.75rem;
    text-align: right;
    border: none;
    background: transparent;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    font-weight: 600;
    color: #6a6f83;
    text-align: left;
  }
}
