/* NetPulse – core styles (RTL, mobile-first, glass cards) */

:root {
  --font-fa: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
  --max-w: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-fa);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover {
  opacity: 0.85;
}

button,
.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:active,
.btn:active {
  transform: scale(0.98);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0;
  direction: ltr;
  unicode-bidi: isolate;
}
.logo span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  color: var(--text-muted);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  color: var(--text);
  background: var(--surface-hover);
}

.theme-toggle {
  background: var(--surface);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border: 1px solid var(--border);
}

.menu-btn {
  display: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  padding: 0.4rem;
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.08);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 1rem 0 3rem;
}
.tool-card {
  text-align: center;
  padding: 1.75rem 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}
.tool-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.tool-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  direction: ltr;
  text-align: left;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Results */
.results {
  margin-top: 1.5rem;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.metric {
  text-align: center;
  padding: 1.1rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  direction: ltr;
}
.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.progress-wrap {
  margin: 1.5rem 0;
  text-align: center;
}
.stage-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  padding: 0.65rem 0.85rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--surface-2);
  font-weight: 600;
}
tr:last-child td {
  border-bottom: none;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.pill-green {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.pill-red {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
.pill-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}
.pill-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}

.footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.text-center {
  text-align: center;
}
.ltr {
  direction: ltr;
  text-align: left;
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav.open {
    display: flex;
  }
  .menu-btn {
    display: block;
  }
  .hero {
    padding: 2.5rem 0 1.5rem;
  }
  .metric-value {
    font-size: 1.35rem;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 0 0.75rem;
  }
  .card {
    padding: 1.15rem;
  }
}
