﻿:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
    --btn-green: #22c55e;
    --btn-green-dark: #16a34a;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
.mobile-finance-view {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    padding: 12px;
    color: var(--text);
    line-height: 1.6;
}

/* دکمه افزودن */
.btn-add-mobile {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--btn-green);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

    .btn-add-mobile:hover {
        background: var(--btn-green-dark);
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
    }

/* تب‌ها */
.mobile-tab-header {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: var(--card-bg);
    padding: 4px;
    border-radius: var(--radius);
}

    .mobile-tab-header li {
        flex: 1;
        text-align: center;
        padding: 10px 0;
        font-size: 14px;
        border-radius: 6px;
        background: transparent;
        cursor: pointer;
        transition: var(--transition);
        font-weight: 500;
        color: var(--text-muted);
    }

        .mobile-tab-header li.active {
            background: var(--primary);
            color: white;
            font-weight: 600;
        }

        .mobile-tab-header li:not(.active):hover {
            background: #f1f5f9;
            color: var(--text);
        }

/* محتوای تب */
.mobile-tab-content {
    position: relative;
    scroll-behavior: smooth;
}

.mobile-list {
    display: none;
    animation: fadeInUp 0.3s ease;
}

    .mobile-list.active {
        display: block;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-total-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-card {
    position: relative;
    padding-right: 32px; /* فضای کافی برای چک‌باکس در راست */
}

.card-select {
    position: absolute;
    top: 10px;
    right: 10px; /* ← مهم: چک‌باکس در راست */
    z-index: 2;
}

.card-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* جلوگیری از برخورد مبلغ با چک‌باکس */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 24px;
}

.item-amount {
    text-align: left;
    padding-left: 4px; /* فاصله کم برای خوانایی */
}

.card-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ظرافت بیشتر برای "انتخاب همه" */
.select-all-mobile label {
    cursor: pointer;
}

/* کارت آیتم */
.mobile-card {
    background: var(--card-bg);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    transition: var(--transition);
    animation: cardEntrance 0.4s ease-out;
    padding-bottom: 120px;
    min-height: 160px;
}

    .mobile-card:hover {
        border-color: #cbd5e1;
    }

.card-actions {
    margin-top: 16px;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}



@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mobile-card:active {
    transform: scale(0.98);
}

/* هدر کارت */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

    .item-header strong {
        font-size: 16px;
        font-weight: 600;
        color: var(--text);
    }

.item-amount {
    font-size: 16px;
    font-weight: 600;
}

/* وضعیت‌ها */
.success,
.danger {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.success {
    color: var(--success);
    background: #f0fdf4;
}

.danger {
    color: var(--danger);
    background: #fef2f2;
}

/* خطوط اطلاعات */
.item-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 0;
}

    .item-line span {
        font-size: 14px;
        color: var(--text);
        direction: ltr;
        text-align: left;
    }

/* آیکن‌ها */
.icons-inline {
    display: flex;
    gap: 6px;
}

    .icons-inline a {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: var(--transition);
    }

        .icons-inline a:first-child {
            background: #f0fdf4;
            color: var(--success);
        }

        .icons-inline a:last-child {
            background: #eff6ff;
            color: var(--primary);
        }

        .icons-inline a:hover {
            transform: scale(1.1);
        }

/* آدرس */
.item-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

    .item-address i {
        color: var(--text-muted);
        margin-top: 2px;
    }

.card-edit-btn,
.card-delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.card-edit-btn {
    background: #fffbeb;
    color: var(--warning);
}

.card-delete-btn {
    background: #fef2f2;
    color: var(--danger);
}

.card-edit-btn:hover {
    background: var(--warning);
    color: white;
    transform: scale(1.05);
}

.card-delete-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.05);
}

/* بدون داده */
.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 20px 0;
}

    .no-data i {
        color: #cbd5e1;
        margin-bottom: 12px;
    }

/* رسپانسیو */
@media (max-width: 480px) {
    .mobile-finance-view {
        padding: 8px;
    }

    .mobile-card {
        padding: 12px;
    }

    .card-actions {
        left: 12px;
        bottom: 12px;
    }

    .card-edit-btn,
    .card-delete-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .btn-add-mobile {
        width: 52px;
        height: 52px;
        font-size: 22px;
        bottom: 16px;
        left: 16px;
    }
}

@media (max-width: 360px) {
    .item-line {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .icons-inline {
        align-self: auto;
    }
}

/* فوکوس برای دسترسی‌پذیری */
.card-edit-btn:focus,
.card-delete-btn:focus,
.btn-add-mobile:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
