/* متغیرهای طراحی */
:root {
  --bg1: #ffffff;
  --bg2: #f7f9fc;
  --accent: #06b6d4;
  --highlight: #4fd1c5;
  --muted: #555;
  --card: #ffffff;
  --pay: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 0 10px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
  
  /* اندازه فونت پایه - بزرگتر شده */
  --font-size-base: 15px;
  --font-size-sm: 13px;
  --font-size-md: 14px;
  --font-size-lg: 17px;
  --font-size-xl: 20px;
  --font-size-2xl: 40px;
}

/* فونت و ریست */
@font-face {
  font-family: 'Vazirmatn Fallback';
  src: local('Tahoma'), local('Arial');
  size-adjust: 105%;
  ascent-override: 95%;
}

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Vazirmatn', 'Vazirmatn Fallback', Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  color: #111;
  overflow-x: hidden;
  padding: 0 20px;
  font-size: var(--font-size-base);
  line-height: 1.5;
}

/* Navigation Styles */
.navbar {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.8rem 0;
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2%;
}

.nav-brand h1 {
  color: var(--accent);
  font-size: 1.4rem;
  margin: 0;
  font-weight: 700;
}

.nav-brand span {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.3s ease;
  font-size: var(--font-size-md);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--accent);
  margin: 2px 0;
  transition: 0.3s;
}

.user-menu {
  position: relative;
  display: inline-block;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  border-radius: 6px;
  padding: 0.4rem;
  min-width: 140px;
  z-index: 1001;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 0.4rem 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: var(--font-size-sm);
}

.user-dropdown a:hover {
  color: var(--accent);
  background: var(--bg2);
}

/* استایل‌های اصلی */
header {
  text-align: center;
  padding: 25px 0 8px;
}

header h1 {
  font-size: var(--font-size-2xl);
  color: #06b6d4;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

header h2 {
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
}

.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 15px 2%;
  box-sizing: border-box;
}

.card, .trust-card, .steps-card, .card-component {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-component:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

h3 {
  margin-top: 0;
  font-size: var(--font-size-lg);
  color: #06b6d4;
  font-weight: 600;
  margin-bottom: 12px;
}

/* استایل‌های مخصوص trust-card */
.trust-card .small {
  font-size: var(--font-size-md) !important;
  line-height: 1.7;
  color: var(--muted);
}

.trust-card .small strong {
  font-size: var(--font-size-md);
  color: var(--accent);
  font-weight: 700;
}

.trust-card p.small {
  margin-bottom: 12px;
}

.trust-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: var(--font-size-md);
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  transition: all .2s ease;
  box-sizing: border-box;
  font-family: inherit;
  font-size: var(--font-size-md);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #f0fcff;
}

textarea {
  resize: vertical;
  min-height: 70px;
  max-height: 180px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.char-counter {
  font-size: var(--font-size-sm);
  color: var(--muted);
  text-align: left;
  margin-top: 3px;
}

.char-counter.warning {
  color: #f59e0b;
}

.char-counter.error {
  color: #ef4444;
}

.asset-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.asset-inputs {
  display: flex;
  flex-direction: column;
}

.asset-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.asset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border-radius: 6px;
  padding: 6px 10px;
  border: 1px solid #eee;
  font-size: var(--font-size-sm);
}

.asset-item input {
  width: 90px;
  text-align: center;
  font-size: var(--font-size-sm);
  padding: 4px;
}

.asset-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0faff;
  border-radius: 6px;
  padding: 8px 14px;
  margin-top: 8px;
  color: #0a3c4a;
  font-size: var(--font-size-md);
}

.chart-container {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
}

.chart-title {
  font-size: var(--font-size-md);
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    #06b6d4 0% 0%,
    #4fd1c5 0% 0%,
    #0ea5e9 0% 0%,
    #10b981 0% 0%,
    #f59e0b 0% 0%,
    #ef4444 0% 0%,
    #8b5cf6 0% 0%,
    #64748b 0% 0%
  );
  position: relative;
  margin-bottom: 16px;
}

.donut-center {
  position: absolute;
  width: 60%;
  height: 60%;
  background: white;
  border-radius: 50%;
  top: 20%;
  left: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.total-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: #06b6d4;
  line-height: 1.2;
}

.total-label {
  font-size: var(--font-size-sm);
  color: var(--muted);
}

.chart-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-sm);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.compact-radio-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.compact-radio-group label {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 12px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-weight: normal;
}

.compact-radio-group label:hover {
  background: #e6faff;
  border-color: var(--accent);
}

.compact-radio-group input[type="radio"] {
  accent-color: var(--accent);
  transform: scale(0.9);
  margin: 0;
}

.compact-form-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.compact-form-group > label {
  margin-bottom: 0;
  min-width: 110px;
  font-size: var(--font-size-md);
  color: var(--muted);
  flex-shrink: 0;
  font-weight: 500;
}

.compact-form-group .compact-radio-group {
  flex: 1;
}

.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  font-size: var(--font-size-md);
  font-family: inherit;
  line-height: 1.2;
}

.btn-primary {
  background: var(--pay);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  box-shadow: 0 0 10px var(--pay);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f8f9fa;
  color: var(--muted);
  border: 1px solid #dee2e6;
}

.btn-secondary:hover {
  background: #e9ecef;
}

.btn-premium {
  background: linear-gradient(135deg, #d4af37, #ffd700);
  color: #000;
  font-weight: 700;
}

.btn-premium:hover {
  background: linear-gradient(135deg, #ffd700, #d4af37);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.prompt-box {
  background: #f8fafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px;
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: #333;
  overflow: auto;
  min-height: 160px;
  margin-top: 16px;
}

.footer-advanced {
  margin-top: 25px;
  padding: 14px 20px;
  background: #f5f7fa;
  border-radius: 10px;
  display: flex;
  justify-content: center;
}

.footer-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-left span {
  color: #666;
  font-size: var(--font-size-md);
}

.footer-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* استایل‌های جدید برای آیکون‌های اجتماعی */
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 16px;
}

.social-icon:hover {
  background: var(--pay);
  transform: scale(1.1);
  color: white;
}

.step-item {
  padding: 8px 0;
  transition: all 0.2s ease;
  font-size: var(--font-size-md);
  position: relative;
  padding-right: 8px;
}

.step-item:hover {
  background-color: #f0fcff;
  border-radius: 6px;
  padding-right: 10px;
}

/* اعتبارسنجی فیلدها */
.form-group input:invalid,
.form-group select:invalid {
  border-color: var(--error);
}

.form-group input:valid,
.form-group select:valid {
  border-color: var(--success);
}

.field-error {
  color: var(--error);
  font-size: var(--font-size-sm);
  margin-top: 3px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--card);
  margin: 5% auto;
  padding: 18px;
  border-radius: 10px;
  width: 90%;
  max-width: 450px;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notification */
.notification {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 6px;
  color: white;
  z-index: 3000;
  animation: slideDown 0.3s ease;
  font-size: var(--font-size-md);
  font-weight: 500;
}

.notification.success {
  background: var(--success);
}

.notification.error {
  background: var(--error);
}

.notification.warning {
  background: var(--warning);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 16px;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 6px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* متن‌های کوچک */
.small {
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

/* رسپانسیو */
@media (max-width: 768px) {
  html, body {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 14px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .compact-form-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .compact-radio-group {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  
  .compact-radio-group label {
    flex: 1;
    min-width: 90px;
    font-size: 12px;
    padding: 5px 8px;
  }
  
  .asset-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .asset-group {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .chart-legend {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-right {
    justify-content: center;
    flex-wrap: wrap;
  }

  .social-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  header {
    padding: 20px 0 6px;
  }
  
  header h1 {
    font-size: 32px;
  }
  
  header h2 {
    font-size: 15px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: var(--card);
    flex-direction: column;
    padding: 0.8rem;
    box-shadow: var(--shadow-lg);
    gap: 0.8rem;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .modal-content {
    margin: 8% auto;
    width: 95%;
    padding: 16px;
  }
  
  .container {
    padding: 12px 2%;
  }
  
  .card, .trust-card, .steps-card, .card-component {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  .donut-chart {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 480px) {
  html, body {
    padding-left: 5px;
    padding-right: 5px;
  }
  
  header h1 {
    font-size: 28px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}