/* متغیرها و فونت‌ها تغییری نکردند */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-latin-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
    --primary: #112548;
    --primary-hover: #1e3a6e;
    --bg-input: #f8fafc;
    --border-light: #e2e8f0;
    --danger: #e63946;
    --success: #2a9d8f;
}

body {
    font-family: "Baloo Bhaijaan 2", sans-serif;
    background-color: #f1f5f9; /* یک پس‌زمینه ملایم برای تمایز بهتر */
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.main-container {
  display: flex;
  flex-direction: row;
}

.main-content {
  padding: clamp(1rem, 2vw, 2rem);
  margin: clamp(0.5rem, 1.5vw, 1.5rem);
  background-color: #ffffff;
  border-radius: 24px;
  font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
  text-align: right; /* راست‌چین کردن محتوای اصلی */
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--primary);
  width: 100%;
}

.em-container {
    background: #ffffff;
    border: 2px solid var(--border-light);
    border-radius: 24px;
    padding: clamp(1rem, 2vw, 2rem);
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.em-search-box {
    width: 100%;
    padding: 0 15px;
    height: 50px;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    margin-bottom: 15px; /* فاصله کمی کمتر شد تا به راهنما نزدیک‌تر شود */
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    background-color: var(--bg-input);
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.em-search-box:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(17, 37, 72, 0.1);
    transform: translateY(-2px);
}

.em-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 25px;
    text-align: center;
}

.em-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.em-card {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.em-card:hover {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* اضافه شدن سایه در حالت هاور */
}

.em-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    outline: none; /* برای فوکوس کیبورد */
}

.em-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* آیکون فلش که در کد قبلی بود اما ساختارش ناقص بود */
.em-icon {
    font-size: 0.8rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    background: #e2e8f0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.em-card:has(.active) .em-icon {
    transform: rotate(180deg);
    background: var(--primary);
    color: #fff; /* وقتی باز است رنگ آیکون تغییر کند */
}

.em-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--danger);
    direction: ltr;
}

.em-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
}

.em-call-btn {
    background: linear-gradient(135deg, #2a6c9d 0%, #213286 100%);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(42, 157, 143, 0.2);
    transition: all 0.3s ease;
}

.em-call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(42, 157, 143, 0.4);
}

.em-description {
    display: none;
    font-size: 0.95rem;
    color: #475569;
    border-top: 1px dashed var(--border-light);
    margin-top: 15px;
    padding-top: 15px;
    line-height: 1.8;
    text-align: right;
}

.em-description.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* استایل‌های بخش مقالات */
.description {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-align: right;
  font-size: clamp(0.875rem, 0.731rem + 0.638vw, 1.25rem);
  border: 2px solid var(--border-light);
}

.description-title {
  font-size: clamp(1rem, 0.809rem + 0.851vw, 1.5rem);
  color: var(--primary);
  margin-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 10px;
  display: inline-block;
}

.description h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    color: var(--primary);
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.description h3 {
    color: var(--primary-hover);
    margin-top: 20px;
}

@media (max-width: 675px) {
    .em-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .em-call-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    .em-info {
        width: 100%;
        justify-content: flex-start;
    }
}

/* استایل جدید برای آیکون فلش */
.em-icon {
    color: var(--primary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #e2e8f0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* چرخش آیکون با انیمیشن نرم‌تر */
.em-card:has(.active) .em-icon {
    transform: rotate(180deg);
    background: var(--primary);
    color: #fff;
}

/* استایل برای شماره‌ها تا حس قابل کلیک بودن بدهند */
.em-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--danger);
    direction: ltr;
    padding: 0 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    cursor: copy; /* تغییر شکل موس به حالت کپی */
}

/* افکت هاور برای خود شماره */
.em-number:hover {
    background-color: #fee2e2; /* یک پس‌زمینه قرمز خیلی روشن */
}

/* استایل پیام پاپ‌آپ (Toast) */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(20px);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* کلاسی که جاوااسکریپت برای نمایش پاپ‌آپ اضافه می‌کند */
#toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    bottom: 40px;
}

.rtl {
    direction: rtl;
}

