@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-light: #334e7c;
    --bg-page: #dae0e2;
    --bg-card: #ffffff;
    --border-light: #e2e8f0;
    
    /* رنگ‌های متغیر بر اساس متد */
    --theme-color: #3376A3; /* پیش‌فرض: آبی */
    --theme-bg: #e0f2fe;
}

/* کلاس‌های تم رنگی */
.theme-box { --theme-color: #3376A3; --theme-bg: #e0f2fe; }
.theme-478 { --theme-color: #6d28d9; --theme-bg: #ede9fe; } /* بنفش */
.theme-stress { --theme-color: #059669; --theme-bg: #d1fae5; } /* سبز */

body {
  background-color: var(--bg-page);
  font-family: 'Baloo Bhaijaan 2', Arial, sans-serif;
  color: var(--primary);
  margin: 0;
}

.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: center;
  /* مدرن‌سازی سایه کانتینر اصلی */
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--primary);
  width: 100%;
}

.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);
}

.exercise-card {
  border-radius: 24px;
  padding: clamp(0.8rem, 0.5vw, 1.6rem);
  border: 2px solid var(--border-light);
  text-align: center;
  transition: all 0.5s ease; 
  width: 100%;
  margin-bottom: 15px;
}


.card-header h1 {
    font-size: 1.5rem;
    margin: 0 0 20px 0;
}

.settings-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.select-wrapper label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 5px;
}

select {
  font-size: 1rem;
  border: 1px solid var(--border-light);
  background-color: #f8fafc;
  height: 40px;
  border-radius: 12px;
  padding: 0 10px;
  font-family: inherit;
  width: 160px;
  outline: none;
  cursor: pointer;
  text-align: center;
  direction: rtl;
}

/* دکمه‌های تاگل صدا و ویبره */
.toggles {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.icon-btn {
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.icon-btn.active {
    background: var(--theme-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* کانتینر انیمیشن */
.visual-container {
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 10px 0;
}

.breathing-circle-outer {
    width: 220px;
    height: 220px;
    background: var(--theme-bg);
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease;
}

.breathing-circle-inner {
    width: 100%;
    height: 100%;
    background: var(--theme-color);
    border-radius: 50%;
    position: absolute;
    transform: scale(0.35);
    opacity: 0.8;
    z-index: 1;
    /* Duration will be set by JS dynamically */
    transition-property: transform;
    transition-timing-function: linear; 
}

.status-text {
    z-index: 2;
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.instruction-sub {
    z-index: 2;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-top: 5px;
}

.timer-display {
    margin-top: 25px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-light);
    font-variant-numeric: tabular-nums;
}

button.pop {
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--primary) 100%);
    border: none;
    color: white;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 250px;
}

button.pop:active {
    transform: scale(0.96);
}

button.pop:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* گرید متدها در راهنما */
.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.method-card {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    text-align: right;
}

.method-card h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--primary);
}

.method-card p {
    font-size: 0.8rem;
    margin: 5px 0;
    color: #64748b;
}

.description {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    text-align: right;
    border: 2px solid var(--border-light);
}

@media (max-width: 600px) {
    .breathing-circle-outer {
        width: 180px;
        height: 180px;
    }
    .settings-row {
        flex-direction: column;
        align-items: stretch;
    }
    select {
        width: 100%;
    }
}

/* اضافه کردن به CSS قبلی */

/* استایل شمارنده وسط دایره */
.phase-timer {
    z-index: 3;
    color: white;
    font-size: 3.5rem; /* عدد بزرگ */
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
    height: 60px; /* ارتفاع ثابت برای جلوگیری از پرش */
    line-height: 60px;
}

/* اصلاح مکان متن وضعیت */
.status-text {
    font-size: 1.4rem;
    margin-bottom: 0;
}

/* حالت توقف دکمه (قرمز) */
button.pop.stop-mode {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

button.pop.stop-mode:hover {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.description {
    line-height: 1.8;
    color: #334155;
}

.description h2 {
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.description h3 {
    color: var(--primary-light);
    font-size: 1.2rem;
    border-right: 4px solid var(--theme-color);
    padding-right: 10px;
}

.method-details {
    list-style: none;
    padding-right: 0;
    font-size: 0.95rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 10px 15px;
}

.method-details li {
    margin-bottom: 5px;
}

.benefits-section ul {
    padding-right: 20px;
}

.benefits-section li {
    margin-bottom: 10px;
    list-style-type: '✔️';
    padding-right: 10px;
}