/* ============================================
   Dashboard Styles - استایل‌های داشبورد
   ============================================ */

:root {
    /* Modern Color Palette */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #7c3aed;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Layout */
    --sidebar-width: 320px;
    --sidebar-collapsed: 80px;
    --header-height: 80px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --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);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.mk-dashboard-section {
    animation: fadeInUp 0.6s ease-out;
}

.mk-stat-card {
    animation: slideInRight 0.6s ease-out;
    animation-fill-mode: both;
}

    .mk-stat-card:nth-child(1) { animation-delay: 0.1s; }
.mk-stat-card:nth-child(2) { animation-delay: 0.2s; }
.mk-stat-card:nth-child(3) { animation-delay: 0.3s; }
.mk-stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.mk-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray-600);
}

.mk-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.mk-error {
    color: var(--danger);
    text-align: center;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--danger);
}

.mk-skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scrollbar Styling */
.mk-dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.mk-dashboard-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.mk-dashboard-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.mk-dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Page Isolation */
body.page-template-dashboard {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #f8fafc;
    font-family: 'IRANYekan', 'IRANYekanWeb', 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body.page-template-dashboard header,
body.page-template-dashboard footer,
body.page-template-dashboard .site-header,
body.page-template-dashboard .site-footer,
body.page-template-dashboard #header,
body.page-template-dashboard #footer {
    display: none !important;
}

/* Main Layout */
.mk-dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.mk-dashboard-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.mk-dashboard-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.mk-dashboard-main {
    flex: 1;
    background: #f8fafc;
    transition: var(--transition);
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    position: relative;
}

.mk-dashboard-wrapper.sidebar-collapsed .mk-dashboard-main {
    margin-right: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}

/* Sidebar Navigation */
.mk-dashboard-nav {
    padding: 0 1.5rem;
}

.mk-dashboard-nav-item {
    margin-bottom: 0.25rem;
}

.mk-dashboard-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--border-radius);
    border-right: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.mk-dashboard-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    z-index: -1;
}

.mk-dashboard-nav-link:hover {
    color: white;
    border-right-color: var(--accent);
    transform: translateX(-4px);
}

.mk-dashboard-nav-link:hover::before {
    width: 100%;
}

.mk-dashboard-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-right-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mk-dashboard-nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    opacity: 0.8;
}

.mk-dashboard-nav-link:hover i,
.mk-dashboard-nav-link.active i {
    opacity: 1;
}

.mk-dashboard-sidebar.collapsed .mk-dashboard-nav-link span {
    display: none;
}

.mk-dashboard-sidebar.collapsed .mk-dashboard-nav-link {
    justify-content: center;
    padding: 1rem;
}

/* Dashboard Header */
.mk-dashboard-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mk-dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mk-dashboard-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.mk-dashboard-user:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.mk-dashboard-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
}

/* Dashboard Content */
.mk-dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.mk-dashboard-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.mk-dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.mk-dashboard-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.mk-dashboard-section:hover::before {
    opacity: 1;
}

.mk-dashboard-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.mk-dashboard-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.mk-dashboard-section-title i {
    color: var(--primary);
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats Cards */
.mk-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.mk-stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.mk-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: var(--transition);
}

.mk-stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.mk-stat-card:hover::before {
    transform: scaleX(1);
}

.mk-stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    z-index: 2;
}

.mk-stat-icon.services {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.mk-stat-icon.views {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    box-shadow: 0 8px 16px rgba(240, 147, 251, 0.3);
}

.mk-stat-icon.rating {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    box-shadow: 0 8px 16px rgba(79, 172, 254, 0.3);
}

.mk-stat-icon.inquiries {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
    box-shadow: 0 8px 16px rgba(67, 233, 123, 0.3);
}

.mk-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--gray-900), var(--gray-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mk-stat-label {
    color: var(--gray-600);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.mk-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mk-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.mk-btn:hover::before {
    left: 100%;
}

.mk-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.mk-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mk-btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.mk-btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.mk-btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
}

/* Sidebar Toggle */
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    z-index: 10;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    transform: scale(1.1);
}

/* Forms */
.mk-form-group {
    margin-bottom: 1.5rem;
}

.mk-form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.mk-form-input,
.mk-form-select,
.mk-form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: white;
    color: var(--gray-900);
}

.mk-form-input:focus,
.mk-form-select:focus,
.mk-form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.mk-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.profile-form {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* No Data Messages */
.no-data-message,
.no-services-message,
.no-recent-services {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--gray-200);
}

.no-data-message i,
.no-services-message i,
.no-recent-services i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data-message h4,
.no-services-message h4,
.no-recent-services h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gray-700);
    font-size: 1.25rem;
}

.no-data-message p,
.no-services-message p,
.no-recent-services p {
    margin: 0;
    font-size: 1rem;
}

/* Tables */
.mk-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.mk-table th,
.mk-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.mk-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
}

.mk-table tbody tr:hover {
    background: var(--gray-50);
}

/* Analytics Cards */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.analytics-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--gray-200);
}

.analytics-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.analytics-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.service-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.service-card:hover::before {
    opacity: 1;
}

.service-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.service-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
    flex: 1;
}

.service-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-status.status-publish {
    background: #dcfce7;
    color: #166534;
}

.service-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.service-status.status-draft {
    background: #f3f4f6;
    color: #374151;
}

.service-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.service-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.service-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Recent Services */
.recent-services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.recent-service-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.service-info h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.no-recent-services {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.no-recent-services i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .mk-dashboard-sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width) !important;
        right: -100%;
        z-index: 1000;
    }

    .mk-dashboard-sidebar.mobile-open {
        transform: translateX(0);
        right: 0;
    }

    .mk-dashboard-main {
        width: 100% !important;
        margin-right: 0 !important;
    }

    .mk-dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .mk-dashboard-content {
        padding: 1rem;
        max-width: 100%;
    }

    .mk-dashboard-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .mk-dashboard-header {
        padding: 0 1rem;
        height: 70px;
    }

    .mk-dashboard-title {
        font-size: 1.25rem;
    }

    .recent-service-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .service-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .mk-stat-card {
        padding: 1.5rem;
    }

    .mk-stat-value {
        font-size: 2rem;
    }
}