/* ==================== CarService User Panel - Modern Theme ==================== */
/* تاریخ: دی ۱۴۰۴ */
/* طراحی: مدرن، پاک و حرفه‌ای */

/* ==================== متغیرهای رنگی - پالت آبی-بنفش ==================== */
:root {
    /* رنگ‌های اصلی */
    --primary-color: #5b7dff;
    --primary-dark: #4461d7;
    --primary-light: #7a97ff;
    --primary-gradient: linear-gradient(135deg, #5b7dff 0%, #8b5cf6 100%);

    --secondary-color: #6366f1;
    --accent-color: #10b981;

    /* رنگ‌های وضعیت */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* رنگ‌های خنثی */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* متن */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;

    /* پس‌زمینه */
    --bg-body: #f9fafb;
    --bg-white: #ffffff;
    --bg-dark: #1f2937;

    /* حاشیه و سایه */
    --border-color: #e5e7eb;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* انیمیشن */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- نام‌های سازگاری با استایل‌های قدیمی صفحات (map به پالت جدید) --- */
    --white-color: var(--bg-white);
    --light-color: var(--gray-100);
    --text-color: var(--text-primary);
    --shadow-hover: var(--shadow-lg);
}

/* ==================== تنظیمات پایه ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ==================== Header - طراحی مدرن و پاک ==================== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo a:hover {
    transform: translateY(-1px);
}

/* User Menu */
.user-menu {
    position: relative;
}

/* پل نامرئی روی فاصله‌ی ۸پیکسلی؛ تا با حرکت ماوس به‌سمت گزینه‌ها، :hover قطع و منو بسته نشود */
.user-menu::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--gray-50);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.user-info:hover {
    background: var(--gray-100);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    display: none;
    z-index: 1001;
    overflow: hidden;
}

@media (hover: hover) {
    .user-menu:hover .user-dropdown {
        display: block;
        animation: slideDown 0.2s ease;
    }
}

/* باز شدن با کلیک/لمس (موبایل و همه‌ی دستگاه‌ها) */
.user-menu.open .user-dropdown {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 14px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    padding-right: 20px;
}

/* ==================== نان‌خرده (Breadcrumb) — صفحات اپ ==================== */
.app-breadcrumb-bar {
    background: var(--white-color, #fff);
    border-bottom: 1px solid var(--border-color);
}
.app-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 12px 0;
    font-size: 13.5px;
}
.app-crumb { display: flex; align-items: center; color: var(--text-secondary); }
.app-crumb a { color: var(--text-secondary); transition: color 0.2s; }
.app-crumb a:hover { color: var(--primary-color); }
.app-crumb.active { color: var(--text-primary); font-weight: 600; }
.app-crumb + .app-crumb::before { content: "/"; margin: 0 8px; color: var(--border-color); }

/* ==================== Navigation - مدرن و Minimal ==================== */
.navigation {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-menu {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--gray-50);
}

.nav-actions {
    display: flex;
    gap: 8px;
}

/* ==================== ناوبری پایین موبایل (اپ) ==================== */
.app-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.app-bottom-nav .abn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: color .18s ease;
}
.app-bottom-nav .abn-item i {
    font-size: 21px;
    line-height: 1;
}
.app-bottom-nav .abn-item.active {
    color: var(--primary-color);
}
.app-bottom-nav .abn-item:active {
    background: var(--gray-50);
}

/* ==================== Main Content ==================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    min-height: calc(100vh - 200px);
}

/* ==================== Footer - مینیمال و پاک ==================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    margin-top: 48px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ==================== Buttons - طراحی مدرن ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* Primary Button */
.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--text-white);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

/* Outline Primary */
.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Outline Secondary */
.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

/* Outline Danger */
.btn-outline-danger {
    background: transparent;
    color: var(--danger-color);
    border: 1.5px solid var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: var(--text-white);
}

/* Success Button */
.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover {
    background: #059669;
    color: var(--text-white);
}

/* Danger Button */
.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--text-white);
}

/* ==================== Cards - مدرن و پاک ==================== */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 24px;
}

.card-header {
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.card-footer {
    padding: 16px 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-white);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 125, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--gray-50);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    line-height: 1;
}

.badge-primary {
    background: rgba(91, 125, 255, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--text-secondary);
}

/* ==================== Alerts ==================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
    color: #1e40af;
}

/* ==================== Utility Classes ==================== */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.text-center {
    text-align: center !important;
}

.text-start {
    text-align: right !important;
}

.text-end {
    text-align: left !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 8px !important; }
.p-2 { padding: 16px !important; }
.p-3 { padding: 24px !important; }
.p-4 { padding: 32px !important; }

/* ==================== Loading Spinner ==================== */
.spinner-border {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .header-content,
    .nav-content {
        height: 60px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .user-name {
        display: none;
    }

    .nav-menu {
        display: none;
    }

    /* در موبایل، ناوبری اصلی اپ به نوار پایین منتقل می‌شود */
    .app-bottom-nav {
        display: flex;
    }
    body.has-bottom-nav {
        padding-bottom: 70px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header-container,
    .nav-container,
    .main-content,
    .footer-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-body {
        padding: 16px;
    }
}

/* ==================== Header — ناوبری سایت عمومی ==================== */
.header { transition: box-shadow .25s ease; }
.header.scrolled { box-shadow: var(--shadow-md); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link-top {
    padding: 8px 14px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}
.nav-link-top:hover { color: var(--primary-color); background: var(--gray-50); }
.nav-sep { width: 1px; height: 24px; background: var(--border-color); margin: 0 8px; }

.nav-toggle {
    display: none;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    width: 42px; height: 42px;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .header-container { position: relative; }
    .main-nav {
        position: absolute;
        top: 100%; right: 0; left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        padding: 12px 16px 18px;
        display: none;
    }
    .main-nav.open { display: flex; }
    .nav-link-top { padding: 12px 14px; }
    .nav-sep { display: none; }
    .main-nav .btn { width: 100%; }
}

/* ==================== Footer — سایت عمومی (گرید) ==================== */
.site-footer { margin-top: 0; padding: 56px 0 28px; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}
.footer-brand .logo { margin-bottom: 14px; }
.footer-tagline { color: var(--text-secondary); font-size: 14px; max-width: 320px; line-height: 1.9; margin: 0; }
.footer-col h4 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--text-secondary); font-size: 14px; font-weight: 500; padding: 5px 0; transition: var(--transition-fast); }
.footer-col a:hover { color: var(--primary-color); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 22px;
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ==================== هدر کمینه + صفحه‌ی خطا ==================== */
.header-content-center { justify-content: center !important; }

.error-page {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.error-code {
    font-size: clamp(72px, 14vw, 120px);
    font-weight: 800;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-title { font-size: 24px; font-weight: 800; margin: 14px 0 8px; color: var(--text-primary); }
.error-message { color: var(--text-secondary); font-size: 16px; margin: 0 0 28px; line-height: 1.9; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ==================== Skeleton loading (conventions §۷.۵) ==================== */
.gm-loading > *:not(.gm-skeleton-wrap) { display: none !important; }
.gm-skeleton-wrap { animation: gm-fade .2s ease; }
.gm-loading-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; margin-bottom: 18px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 10px; color: #6b7280; font-size: 13.5px; }
.gm-loading-banner .spinner-border { width: 16px; height: 16px; border-width: 2px; color: #5b7dff; }
.sk { position: relative; overflow: hidden; background: #eef0f3; border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: gm-shimmer 1.2s infinite; }
@keyframes gm-shimmer { 100% { transform: translateX(100%); } }
@keyframes gm-fade { from { opacity: 0; } to { opacity: 1; } }
.sk-title { height: 22px; width: 34%; margin-bottom: 18px; }
.sk-line { height: 12px; margin: 10px 0; }
.sk-card { height: 104px; margin-bottom: 14px; }
.sk-stat { height: 86px; }
.sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 768px) { .sk-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .sk-grid { grid-template-columns: 1fr; } }
