:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --accent: #f59e0b;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
    --header-height: 56px;
    --nav-height: 65px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

@font-face {
    font-family: 'vazir';
    src: url('../fonts/Vazir.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
a{ text-decoration: none}
body {
    background-color: #e8e8ed;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'vazir';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* کانتینر اصلی موبایل */
.mobile-app {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

/* حذف افکت قاب گوشی در صفحه‌نمایش‌های کوچک */
@media (max-width: 500px) {
    .mobile-app {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    body {
        background-color: var(--bg);
    }
}

/* === هدر اپلیکیشن === */
.app-header {
    background: var(--surface);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    z-index: 100;
    gap: 12px;
}
.app-header .logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.app-header .logo i {
    font-size: 1.4rem;
    color: var(--primary);
}
.app-header .header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.btn-icon:active {
    background: #f3f4f6;
    transform: scale(0.92);
}
.btn-icon .badge-dot {
    position: absolute;
    top: 6px;
    left: 8px;
    width: 9px;
    height: 9px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

/* === محتوای اصلی === */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 16px 14px;
    padding-bottom: calc(var(--nav-height) + 20px + var(--safe-bottom));
    background: var(--bg);
}
.app-content::-webkit-scrollbar {
    width: 0;
}

/* === نویگیشن پایین === */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
    border: none;
    background: transparent;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 55px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    flex: 1;
    text-align: center;
}
.nav-item i {
    font-size: 1.35rem;
    transition: all 0.25s;
    position: relative;
    z-index: 2;
}
.nav-item span {
    font-size: 0.68rem;
    transition: all 0.25s;
    z-index: 2;
    white-space: nowrap;
}
.nav-item.active {
    color: var(--primary);
}
.nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary);
}
.nav-item:active:not(.nav-add) {
    transform: scale(0.9);
}
/* دکمه افزودن وسط */
.nav-add-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: -22px;
    z-index: 10;
}
.nav-add {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1C1C1C;
    color: white !important;
    border: 4px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    position: relative;
    z-index: 11;
    flex-shrink: 0;
}
.nav-add:active {
    transform: scale(0.88);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.5);
    background: var(--primary-dark);
}
.nav-add i {
    color: white !important;
    font-size: 1.4rem;
}

/* === صفحات === */
.page {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}
.page.active {
    display: block;
}
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-name{
    border: 1px solid #eee;
    padding: 0px 10px;
    border-radius: 5px;
    box-shadow: 1px -1px 3px 0px #ede8e8;
    font-size: 26px;
    font-weight: bold;
}
/* === کارت ها === */
.card-custom {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 14px;
    transition: all 0.2s;
}
.card-custom:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.card-custom .card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* === استایل‌های کمکی === */
.badge-custom {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.avatar-lg {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    font-size: 1.8rem;
}
.input-search {
    border-radius: 25px;
    padding: 10px 40px 10px 16px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.2s;
    outline: none;
    direction: rtl;
}
.input-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}
.chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    font-size: 0.8rem;
    cursor: pointer;
    margin: 3px;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}
.chip:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}
.text-muted-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === مودال افزودن === */
.add-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.add-modal-overlay.show {
    display: flex;
}
.add-modal {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 430px;
    padding: 20px 16px calc(20px + var(--safe-bottom));
    animation: slideUp 0.3s ease;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
.add-modal .modal-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
}
.modal-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: right;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}
.modal-option:active {
    background: #f3f4f6;
}
.modal-option .modal-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Toast */
.toast-mini {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    font-weight: 500;
}
.toast-mini.show {
    opacity: 1;
}
