/* فونت وزیر */
@font-face {
    font-family: 'Vazirmatn';
    src: url('Vazirmatn-Regular.woff2') format('woff2');
    font-display: swap;
}

:root {
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --brand-color: #0066ff;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.03);
    --card-hover-shadow: 0 12px 24px rgba(0,0,0,0.08);
    --navbar-bg: rgba(255, 255, 255, 0.85);
    
    /* متغیرهای اسکلت لودینگ */
    --skeleton-bg: #e0e0e0;
    --skeleton-highlight: #f0f0f0;

    /* متغیرهای ویجت ساعت و انگیزه */
    --clock-face: #f0f2f5;
    --clock-hand: #333;
    --quote-bg: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --quote-text: #495057;
}

[data-bs-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #e0e0e0;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.3);
    --card-hover-shadow: 0 12px 24px rgba(0,0,0,0.5);
    --navbar-bg: rgba(30, 30, 30, 0.85);
    
    /* دارک مود */
    --skeleton-bg: #2d2d2d;
    --skeleton-highlight: #3d3d3d;
    --clock-face: #2c2c2c;
    --clock-hand: #eee;
    --quote-bg: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    --quote-text: #adb5bd;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar شیشه‌ای */
.glass-effect {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hero-section { padding: 2rem 1rem 0.5rem; text-align: center; }

.brand-logo {
    font-size: 2.2rem; font-weight: 800; color: var(--brand-color);
    margin-bottom: 10px; letter-spacing: -1px;
}

/* جستجوی چسبان */
.sticky-search-wrapper {
    position: sticky;
    top: 70px;
    z-index: 990;
    padding: 10px 0;
}

.search-container { max-width: 600px; margin: 0 auto; position: relative; transition: transform 0.2s; }
.search-container:focus-within { transform: scale(1.01); }

.search-input {
    border-radius: 50px; 
    /* اصلاح پدینگ: فضای بیشتر در سمت چپ برای آیکون‌های صوتی و حذف */
    padding: 14px 50px 14px 90px;
    border: 2px solid transparent; box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    font-size: 1rem; transition: all 0.3s ease;
    background-color: var(--bg-card); color: var(--text-primary);
}
.search-input:focus {
    border-color: var(--brand-color);
    box-shadow: 0 8px 25px rgba(0,102,255,0.2); outline: none;
}

.search-icon {
    position: absolute; right: 20px; top: 50%;
    transform: translateY(-50%); color: var(--brand-color); font-size: 1.1rem; pointer-events: none;
}

/* --- استایل جدید برای دکمه‌های سمت چپ (صدا و حذف) --- */
.search-actions {
    position: absolute; 
    left: 20px; 
    top: 50%; 
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
}

.clear-search, .voice-search {
    color: #999; 
    cursor: pointer; 
    font-size: 1.3rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover { color: #dc3545; }
.voice-search:hover { color: var(--brand-color); transform: scale(1.1); }

/* انیمیشن ضبط صدا */
.voice-search.listening {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* دسته‌بندی‌ها */
.category-scroll-wrapper {
    overflow-x: auto; white-space: nowrap; padding-bottom: 15px; margin-bottom: 20px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.category-scroll-wrapper::-webkit-scrollbar { display: none; }

.category-btn {
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 4px; padding: 8px 18px;
    border-radius: 50px; background-color: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.08); color: #6c757d; cursor: pointer;
    transition: all 0.2s ease; font-weight: 500; font-size: 0.9rem; user-select: none;
}
.category-btn:hover { background-color: #e9ecef; color: #333; transform: translateY(-2px); }
.category-btn.active {
    background-color: var(--brand-color); color: white;
    border-color: var(--brand-color); box-shadow: 0 4px 12px rgba(0,102,255,0.3);
}

/* --- بخش بازدیدهای اخیر (بروزرسانی شده) --- */
.recent-section {
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.recent-label {
    font-size: 0.85rem; font-weight: bold; color: var(--text-primary); 
    display: block; opacity: 0.7;
    margin-bottom: 0; /* اصلاح شد تا با هدر هماهنگ شود */
}

/* دکمه حذف همه */
.clear-all-recent {
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.clear-all-recent:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.recent-scroll {
    display: flex; gap: 10px; overflow-x: auto; padding: 5px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.recent-scroll::-webkit-scrollbar { display: none; }

.recent-chip {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-card); padding: 8px 15px;
    border-radius: 12px; text-decoration: none; color: var(--text-primary);
    border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: all 0.2s; font-size: 0.85rem;
    position: relative;
    padding-left: 30px; /* فضا برای دکمه حذف */
}
.recent-chip:hover {
    transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0,0,0,0.08); border-color: var(--brand-color);
}
.recent-chip i { color: var(--brand-color); }

/* دکمه حذف تکی (ضربدر) */
.remove-recent-item {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 2;
}
.remove-recent-item:hover {
    background-color: #dc3545;
    color: white;
}

/* --- ویجت‌های جدید (New Widgets) --- */
.info-card {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.info-card:hover { transform: translateY(-3px); }

/* لیست تاریخ‌ها */
.date-list i { min-width: 20px; text-align: center; }

/* ساعت عقربه‌ای */
.analog-clock {
    width: 70px; height: 70px;
    background: var(--clock-face);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.hand {
    position: absolute;
    bottom: 50%; left: 50%;
    transform-origin: bottom; /* چرخش از پایین */
    background: var(--clock-hand);
    border-radius: 4px;
    transform: translateX(-50%); /* مرکز کردن */
    z-index: 2;
    transition: transform 0.05s cubic-bezier(0.4, 2.08, 0.55, 0.44); /* حرکت تیک‌تاکی */
}
.hour-hand { width: 4px; height: 18px; z-index: 3; }
.min-hand { width: 2px; height: 26px; z-index: 2; opacity: 0.8; }
.sec-hand { 
    width: 1px; height: 30px; 
    background: var(--brand-color); 
    z-index: 4; 
    transition: transform 0.02s linear; /* ثانیه‌شمار روان */
}
.center-dot {
    width: 8px; height: 8px; background: var(--brand-color);
    border-radius: 50%; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 5;
}

/* کارت جمله */
.quote-card {
    background: var(--quote-bg);
}
.quote-icon {
    top: -10px; left: 10px;
}
.quote-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--quote-text);
}

/* شبکه کارت‌ها */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px; padding-bottom: 50px;
}

/* Focus Effect */
.services-grid:has(.service-card:hover) .service-card:not(:hover) {
    opacity: 0.6;
    filter: grayscale(0.5) blur(1px);
    transform: scale(0.98);
}

.service-card {
    background-color: var(--bg-card); border-radius: 24px; padding: 20px;
    text-align: center; text-decoration: none; color: inherit;
    border: 1px solid rgba(0,0,0,0.03); box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column; align-items: center;
    height: 100%; position: relative; overflow: hidden;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--card-hover-shadow); z-index: 10; opacity: 1 !important; filter: none !important; }

/* --- استایل دکمه لایک --- */
.fav-btn {
    position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
    border-radius: 50%; background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center;
    color: #ccc; cursor: pointer; z-index: 10; transition: all 0.2s ease; opacity: 0; 
}
.service-card:hover .fav-btn, .fav-btn.active { opacity: 1; }
.fav-btn.active { color: #dc3545; background: rgba(255, 220, 220, 0.5); border-color: rgba(220, 53, 69, 0.2); }
.fav-btn:hover { transform: scale(1.1); }
[data-bs-theme="dark"] .fav-btn { background: rgba(50, 50, 50, 0.9); border-color: rgba(255, 255, 255, 0.1); }

.service-logo {
    width: 60px; height: 60px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px; transition: transform 0.3s;
    color: white; font-size: 1.6rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.service-card:hover .service-logo { transform: scale(1.15) rotate(5deg); }

.service-title {
    font-weight: 700; font-size: 0.95rem; margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

.bi-heart , .bi-heart-fill {height:16px}

/* استایل توضیحات واقعی (باکس طوسی) */
.service-desc {
    font-size: 0.75rem; 
    color: #6c757d; 
    line-height: 1.5;
    background-color: rgba(0,0,0,0.04); /* باکس طوسی */
    padding: 6px 3px;
    border-radius: 10px;
    margin-top: 8px;
    width: 100%;
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
    text-align: center;
}
[data-bs-theme="dark"] .service-desc { 
    color: #a0a0a0; 
    background-color: rgba(255,255,255,0.05); /* باکس روشن‌تر در دارک مود */
}

/* Skeleton Loading */
.skeleton-card {
    background-color: var(--bg-card); border-radius: 24px; padding: 20px;
    display: flex; flex-direction: column; align-items: center;
    border: 1px solid rgba(0,0,0,0.03);
}
.skeleton-anim {
    background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-highlight) 50%, var(--skeleton-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite ease-in-out;
    border-radius: 12px;
}
.skeleton-logo { width: 60px; height: 60px; border-radius: 20px; margin-bottom: 15px; }
.skeleton-title { width: 80%; height: 16px; margin-bottom: 10px; }

/* اصلاح شده برای متمایز کردن بخش توضیحات اسکلتی */
.skeleton-desc { 
    width: 70%; 
    height: 10px; 
    margin-top: 8px;
    filter: brightness(0.9);
}

@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast Notifications */
.toast-container {
    position: fixed; bottom: 20px; left: 20px; z-index: 1060;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast-msg {
    background: rgba(33, 37, 41, 0.9); color: #fff;
    padding: 12px 20px; border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 0.9rem; display: flex; align-items: center; gap: 10px;
    backdrop-filter: blur(5px);
    animation: slideInToast 0.3s ease-out forwards;
    pointer-events: auto;
}
.toast-msg.success i { color: #2ecc71; }
.toast-msg.info i { color: #3498db; }
[data-bs-theme="dark"] .toast-msg { background: rgba(255, 255, 255, 0.9); color: #000; }

@keyframes slideInToast {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideOutToast {
    to { transform: translateY(20px); opacity: 0; }
}

/* برند رنگ‌ها */
.brand-green { background: linear-gradient(135deg, #21cf5f, #0ea845); }
.brand-red { background: linear-gradient(135deg, #ef394e, #c71f32); }
.brand-blue { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
.brand-orange { background: linear-gradient(135deg, #ff5722, #e64a19); }
.brand-purple { background: linear-gradient(135deg, #8b25a3, #6a1b7d); }
.brand-teal { background: linear-gradient(135deg, #20c997, #149970); }
.brand-gold { background: linear-gradient(135deg, #ffc107, #d39e00); }
.brand-dark { background: linear-gradient(135deg, #343a40, #212529); }
.brand-pink { background: linear-gradient(135deg, #e83e8c, #d63384); }

/* Footer */
footer {
    margin-top: auto; background: var(--bg-card);
    border-top: 1px solid rgba(0,0,0,0.05); padding: 30px 20px;
    text-align: center; font-size: 0.9rem;
}
.footer-links a {
    color: var(--text-primary); text-decoration: none;
    font-weight: 500; transition: color 0.2s; padding: 5px 10px;
}
.footer-links a:hover { color: var(--brand-color); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.4s ease-out forwards; }
.fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }

/* --- استایل‌های داشبورد مدیریت --- */
.stat-card {
    transition: transform 0.2s;
    border: none;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-5px);
}
.stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    left: 15px;
    bottom: 10px;
}
.table th {
    font-weight: 600;
    color: var(--text-primary);
    background-color: rgba(0,0,0,0.02);
}
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
}
.nav-tabs .nav-link.active {
    color: var(--brand-color);
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--brand-color);
}

/* Custom Modal Styles */
.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}
.custom-modal {
    background: var(--bg-card);
    width: 90%; max-width: 400px;
    padding: 30px; border-radius: 24px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    transform: scale(0.9);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.modal-icon {
    font-size: 3rem; color: #dc3545; margin-bottom: 15px;
}
.custom-modal h3 { font-size: 1.2rem; margin-bottom: 10px; font-weight: 800; }
.custom-modal p { color: var(--text-primary); opacity: 0.8; font-size: 0.9rem; margin-bottom: 25px; }

.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-modal {
    border: none; padding: 10px 25px; border-radius: 12px;
    font-family: inherit; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-cancel { background: rgba(128,128,128,0.15); color: var(--text-primary); }
.btn-cancel:hover { background: rgba(128,128,128,0.25); }

.btn-confirm { background: #dc3545; color: white; box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3); }
.btn-confirm:hover { background: #bb2d3b; transform: translateY(-2px); }

@keyframes popIn { to { transform: scale(1); } }
.d-none { display: none !important; }