/* استایل‌های مخصوص نمایش جداول در موبایل */
/* این فایل برای بهبود تجربه کاربری در دستگاه‌های موبایل طراحی شده است */

/* بهبود نمایش جداول در صفحات کوچک */
@media (max-width: 768px) {
    /* تنظیمات کلی جداول */
    .admin-table {
        font-size: 0.85rem;
        min-width: 800px !important; /* حداقل عرض برای اسکرول افقی */
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    /* Header ثابت در موبایل */
    .admin-table th {
        position: sticky;
        top: 0;
        background: #f8fafc;
        z-index: 10;
        border-bottom: 2px solid #e2e8f0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* بهبود نمایش دکمه‌ها در جداول */
    .admin-table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        min-width: auto;
        margin: 0.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .admin-table .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .admin-table .btn-group .btn {
        width: 100%;
        margin: 0;
    }
    
    /* بهبود نمایش دکمه‌های عملیات */
    .admin-table td:last-child {
        min-width: 120px;
        max-width: 150px;
    }
    
    .admin-table td:last-child .btn {
        display: block;
        width: 100%;
        margin: 0.1rem 0;
        text-align: center;
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    /* بهبود نمایش دکمه‌های وضعیت */
    .status-select {
        width: 100%;
        font-size: 0.7rem;
        padding: 0.2rem;
        margin-top: 0.25rem;
    }
    
    /* بهبود نمایش تصاویر در جداول */
    .admin-table img {
        width: 40px !important;
        height: 40px !important;
        object-fit: cover;
        border-radius: 6px;
    }
    
    /* بهبود نمایش متن‌های طولانی */
    .admin-table td {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* بهبود نمایش وضعیت‌ها */
    .status-badge,
    .payment-method-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* بهبود نمایش جداول در صفحات خیلی کوچک */
@media (max-width: 480px) {
    .admin-table {
        font-size: 0.8rem;
        min-width: 700px !important; /* کمتر از 768px اما همچنان قابل اسکرول */
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.25rem 0.15rem;
    }
    
    .admin-table .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    /* بهبود نمایش دکمه‌های عملیات در صفحات خیلی کوچک */
    .admin-table td:last-child {
        min-width: 100px;
        max-width: 120px;
    }
    
    .admin-table td:last-child .btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* بهبود نمایش select وضعیت */
    .status-select {
        font-size: 0.65rem;
        padding: 0.15rem;
    }
    
    /* مخفی کردن ستون‌های غیرضروری در موبایل */
    .admin-table th.hide-mobile,
    .admin-table td.hide-mobile {
        display: none;
    }
    
    /* بهبود نمایش کارت‌های جدول */
    .admin-card.table-card {
        padding: 0.5rem;
        margin: 0.5rem;
    }
    
    .table-responsive {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
        border-radius: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        max-width: 100vw;
    }
}

/* بهبود نمایش جداول در حالت landscape موبایل */
@media (max-width: 768px) and (orientation: landscape) {
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.4rem 0.3rem;
    }
    
    .admin-table td:last-child {
        min-width: 140px;
    }
    
    .admin-table td:last-child .btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* بهبود نمایش جداول در تبلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.6rem 0.4rem;
    }
    
    .admin-table .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .admin-table td:last-child {
        min-width: 160px;
    }
    
    .admin-table td:last-child .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
    }
}

/* بهبود نمایش اسکرول‌بار در موبایل */
@media (max-width: 768px) {
    .table-responsive::-webkit-scrollbar {
        height: 12px; /* ضخیم‌تر برای لمس بهتر */
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 6px;
        margin: 0 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #6366f1, #8b5cf6);
        border-radius: 6px;
        border: 2px solid #f1f5f9;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
    }
    
    .table-responsive::-webkit-scrollbar-thumb:active {
        background: linear-gradient(135deg, #4338ca, #6d28d9);
    }
    
    /* بهبود نمایش جداول در موبایل */
    .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--card-bg);
        position: relative;
    }
    
    /* نشان‌دهنده اسکرول افقی */
    .table-responsive::after {
        content: '← کشیده تا مشاهده بیشتر →';
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.7rem;
        color: #6b7280;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0.8;
        animation: fadeInOut 3s ease-in-out infinite;
        display: var(--scroll-indicator, block);
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.4; }
        50% { opacity: 0.8; }
    }
    
    /* بهبود نمایش دکمه‌ها در موبایل */
    .admin-table .btn {
        border-radius: 6px;
        border: 1px solid var(--border-color);
        transition: all 0.2s ease;
    }
    
    .admin-table .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .admin-table .btn:active {
        transform: translateY(0);
    }
}

/* بهبود نمایش مودال‌ها در موبایل */
@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 1rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-footer {
        padding: 1rem !important;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* بهبود نمایش دکمه‌های خاص */
    .btn-info, .btn-warning, .btn-danger, .btn-success {
        font-weight: 600;
        letter-spacing: 0.5px;
    }
    
    .btn-info {
        background: var(--accent-blue);
        border-color: var(--accent-blue);
    }
    
    .btn-warning {
        background: var(--warning-color);
        border-color: var(--warning-color);
    }
    
    .btn-danger {
        background: var(--error-color);
        border-color: var(--error-color);
    }
    
    .btn-success {
        background: var(--success-color);
        border-color: var(--success-color);
    }
}

/* بهبود نمایش فرم‌ها در موبایل */
@media (max-width: 768px) {
    .admin-form {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-control {
        padding: 0.75rem !important;
        font-size: 1rem !important;
    }
    
    .btn {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
    
    /* بهبود نمایش جداول در موبایل */
    .admin-table {
        border-collapse: separate;
        border-spacing: 0;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .admin-table th {
        background: var(--secondary-bg);
        border-bottom: 2px solid var(--border-color);
        font-weight: 600;
        color: var(--accent-purple);
    }
    
    .admin-table td {
        border-bottom: 1px solid var(--border-color);
        transition: background-color 0.2s ease;
    }
    
    .admin-table tr:hover td {
        background: rgba(139, 92, 246, 0.1);
    }
    
    /* بهبود نمایش دکمه‌های عملیات */
    .admin-table td:last-child {
        background: var(--card-bg);
        border-left: 2px solid var(--accent-purple);
    }
    
    .admin-table td:last-child .btn {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--border-color);
    }
    
    .admin-table td:last-child .btn:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        transform: translateY(-1px);
    }
    
    /* بهبود نمایش دکمه‌های خاص در جداول */
    .admin-table .btn-info {
        background: var(--accent-blue);
        border-color: var(--accent-blue);
        color: white;
    }
    
    .admin-table .btn-warning {
        background: var(--warning-color);
        border-color: var(--warning-color);
        color: white;
    }
    
    .admin-table .btn-danger {
        background: var(--error-color);
        border-color: var(--error-color);
        color: white;
    }
    
    .admin-table .btn-success {
        background: var(--success-color);
        border-color: var(--success-color);
        color: white;
    }
    
    .admin-table .btn-secondary {
        background: var(--text-secondary);
        border-color: var(--text-secondary);
        color: white;
    }
    
    /* بهبود نمایش select وضعیت */
    .admin-table .status-select {
        background: var(--secondary-bg);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 0.7rem;
        padding: 0.25rem;
        width: 100%;
        margin-top: 0.25rem;
    }
    
    .admin-table .status-select:focus {
        outline: 2px solid var(--accent-purple);
        outline-offset: 2px;
    }
}

/* بهبود نمایش آمار در موبایل */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
}

/* بهبود نمایش سایدبار در موبایل */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* بهبود نمایش هدر در موبایل */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem !important;
    }
    
    .header h1 {
        font-size: 1.25rem !important;
    }
    
    .header-actions {
        gap: 0.5rem !important;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
    }
}

/* بهبود نمایش دکمه‌های عملیات در موبایل */
@media (max-width: 768px) {
    /* بهبود نمایش دکمه‌های عملیات */
    .admin-table td:last-child {
        position: relative;
        background: var(--card-bg);
        border-left: 3px solid var(--accent-purple);
        padding: 0.5rem;
    }
    
    .admin-table td:last-child .btn {
        display: block;
        width: 100%;
        margin: 0.15rem 0;
        text-align: center;
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        border-radius: 6px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .admin-table td:last-child .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .admin-table td:last-child .btn:active {
        transform: translateY(0);
    }
    
    /* بهبود نمایش select وضعیت */
    .admin-table .status-select {
        background: var(--secondary-bg);
        color: var(--text-primary);
        border: 2px solid var(--border-color);
        border-radius: 6px;
        font-size: 0.7rem;
        padding: 0.3rem;
        width: 100%;
        margin-top: 0.3rem;
        transition: all 0.2s ease;
    }
    
    .admin-table .status-select:focus {
        outline: none;
        border-color: var(--accent-purple);
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    }
    
    .admin-table .status-select:hover {
        border-color: var(--accent-purple);
    }
}

/* بهبود نمایش جداول در حالت touch */
@media (max-width: 768px) and (hover: none) {
    .admin-table .btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .admin-table .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .admin-table td:last-child .btn:active {
        transform: scale(0.95) translateY(0);
    }
} 