/* تنظیم فونت وزیر متن برای کل سایت */
* {
    font-family: "Vazirmatn", sans-serif !important;
}

:root {
    --bg-color: #0f172a;       /* سرمه‌ای تیره */
    --glass-bg: rgba(30, 41, 59, 0.65); 
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --secondary: #3b82f6;
    --accent: #06b6d4;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #f43f5e;
    
    /* رنگ زرد خوانا برای نقل قول */
    --quote-yellow: #ffd700; 
    --quote-bg: rgba(255, 215, 0, 0.05);
}

/* تم روشن */
body.light-mode {
    --bg-color: #e0f2fe;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #0284c7;
    --quote-yellow: #b45309;
    --quote-bg: rgba(245, 158, 11, 0.1);
}

/* اصلاح آیکون‌ها در تم روشن */
body.light-mode button, body.light-mode i { color: inherit; }
body.light-mode .add-btn { color: #fff; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'MyVazir', sans-serif;
}

/* =========================================
   2. وسط‌چین کردن تضمینی (Dead-Center Layout)
   ========================================= */
html, body {
    height: 100%; /* حیاتی برای وسط‌چین عمودی */
    overflow: hidden; /* حذف اسکرول بار اضافه */
}

body {
    background-color: var(--bg-color);
    display: flex;            /* استفاده از فلکس بجای گرید برای امنیت بیشتر */
    justify-content: center;  /* وسط چین افقی */
    align-items: center;      /* وسط چین عمودی */
    position: relative;
    transition: background-color 0.4s ease;
}

/* این بخش حیاتی است: حذف تاثیر کانتینر */
.container {
    width: 100%;
    height: 100%;
    display: flex;            /* خود کانتینر هم فلکس شود */
    justify-content: center;  /* دوباره محتوا را وسط می‌آورد */
    align-items: center;      
    padding: 15px;            /* فقط برای اینکه در موبایل نچسبد */
}

.glass-card {
    width: 100%;
    max-width: 400px;         /* عرض حداکثر کارت */
    /* پدینگ و گردی‌ها */
    padding: 30px 25px;
    border-radius: 28px;
    
    /* استایل شیشه‌ای */
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    
    /* انیمیشن ریز */
    transition: all 0.3s ease;
    z-index: 10; /* بالاتر از بک‌گراند */
}

/* =========================================
   3. نقل قول (زرد نئونی و خوانا)
   ========================================= */
#quote-box {
    text-align: center;
    margin: 0 0 25px 0; /* فاصله از پایین */
    font-size: 13px;
    line-height: 1.6;
    font-weight: 700; /* ضخیم برای خوانایی */
    
    /* رنگ زرد نئونی */
    color: var(--quote-yellow);
    background: var(--quote-bg);
    border: 1px dashed rgba(255, 215, 0, 0.25);
    
    padding: 12px 15px;
    border-radius: 16px;
    
    /* افکت درخشش Glow */
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.03);
    
    cursor: default;
    transition: transform 0.3s;
}

#quote-box:hover {
    transform: scale(1.02);
    background: rgba(255, 215, 0, 0.1);
}

/* آیکون لودینگ داخل باکس */
#quote-box i { margin-left: 5px; }


/* =========================================
   4. هدر و دکمه‌ها (افقی و مرتب)
   ========================================= */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 15px;
}

.title-section h1 {
    font-size: 24px;
    background: linear-gradient(to left, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.title-section p {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.header-controls {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    padding: 5px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.control-btn {
    width: 38px; height: 38px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    border: none; cursor: pointer;
    transition: 0.3s;
}

/* دکمه تم */
.theme-toggler { background: transparent; color: var(--text-muted); }
.theme-toggler:hover {
    background: rgba(255,255,255,0.1);
    color: var(--quote-yellow); /* وقتی هاور میشه زرد بشه مثل خورشید */
    transform: rotate(180deg);
}

/* لوگوی برند */
.logo-brand {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.logo-brand:hover { transform: scale(1.1); }

/* =========================================
   5. المان‌های ورودی (Input, Buttons)
   ========================================= */
.input-group {
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--glass-border);
    border-radius: 18px; padding: 6px; margin-bottom: 25px;
    transition: 0.3s; 
}
.input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(6,182,212,0.2);
}
body.light-mode .input-group { background: rgba(255,255,255,0.6); }

input {
    flex: 1; background: transparent; border: none; padding: 10px;
    color: var(--text-main); outline: none; font-size: 14px;
}
input::placeholder { color: var(--text-muted); opacity: 0.7; }

.input-group button {
    width: 42px; height: 42px; border: none; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px; transition: 0.2s;
}
.mic-btn { background: transparent; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }
.mic-btn:hover { background: rgba(255,255,255,0.1); color: var(--accent); }
.mic-btn.listening { border-color: var(--danger); color: var(--danger); animation: pulse 1.5s infinite; }
body.light-mode .mic-btn { border-color: rgba(0,0,0,0.1); }

.add-btn { background: var(--text-main); color: var(--bg-color); }
.add-btn:hover { background: var(--accent); color: #fff; box-shadow: 0 0 12px rgba(6,182,212,0.5); }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,0.4); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }


/* =========================================
   6. سایر اجزا (Progress, List, Tabs)
   ========================================= */
.progress-section { margin-bottom: 25px; }
.progress-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.progress-bar-bg { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 10px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 10px var(--primary); }

.filter-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.filter-tabs span { padding: 6px 12px; border-radius: 10px; color: var(--text-muted); font-size: 12px; cursor: pointer; transition: 0.3s; }
.filter-tabs span:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.filter-tabs span.active { background: rgba(255,255,255,0.1); color: var(--text-main); font-weight: bold; }
body.light-mode .filter-tabs span.active { background: rgba(0,0,0,0.08); }

#list-container { max-height: 320px; overflow-y: auto; padding-right: 4px; margin-bottom: 5px; }
#list-container::-webkit-scrollbar { width: 4px; }
#list-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

ul li {
    list-style: none; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.04);
    margin-bottom: 8px; border-radius: 14px; padding: 14px; display: flex; align-items: center;
    transition: 0.2s; cursor: grab; color: var(--text-main); font-size: 15px; -webkit-user-select: none; user-select: none;
    position: relative;
}
body.light-mode ul li { background: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
ul li:hover { background: rgba(255,255,255,0.07); transform: translateX(-3px); }
body.light-mode ul li:hover { background: #f8fafc; }

/* طراحی تیک و متن */
ul li::before { content: ''; width: 18px; height: 18px; border: 2px solid var(--text-muted); border-radius: 5px; margin-left: 12px; transition: 0.2s; flex-shrink: 0; }
ul li.checked { opacity: 0.6; color: var(--text-muted); text-decoration: line-through; }
ul li.checked::before { background: var(--success); border-color: var(--success); }

/* دکمه حذف */
ul li span { margin-right: auto; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; border-radius: 8px; transition: 0.2s; cursor: pointer; }
ul li span:hover { color: var(--danger); background: rgba(244,63,94,0.1); }

/* درگ Ghost */
.ghost-task { opacity: 0.5; background: var(--accent) !important; }

#empty-state { text-align: center; margin-top: 20px; color: var(--text-muted); opacity: 0.7; }
#empty-state i { font-size: 35px; display: block; margin-bottom: 10px; }

/* پس زمینه */
.background { z-index: -1; position: absolute; inset: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; animation: float 8s infinite alternate; }
.blob-1 { top: -5%; left: -5%; width: 50vw; height: 50vw; background: var(--primary); }
.blob-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: var(--accent); }
.stars { position: absolute; inset: 0; background-image: radial-gradient(white 1px, transparent 1px); background-size: 50px 50px; opacity: 0.1; }

/* Toast */
#toast-box { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    width: 300px; background: rgba(15,23,42,0.95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px 15px; border-radius: 10px;
    display: flex; align-items: center; font-size: 13px; transform: translateX(110%);
    animation: slideInToast 0.3s forwards; box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.toast i { font-size: 18px; margin-left: 10px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--accent); }
@keyframes slideInToast { 100% { transform: translateX(0); } }

@keyframes float { 0% { transform: translate(0,0); } 100% { transform: translate(20px, -30px); } }

