﻿/* ========================================
   ManageRequests.css - دعم كامل للوضع المظلم
   ======================================== */

/* تعريف المتغيرات للوضع العادي (فاتح) */

:root {
    --bg-card: #ffffff;
    --bg-header: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #1e293b;
    --stat-bg: #F0FAFF;
    --stat-border: #0192EF4F;
    --hover-bg: #f8fafc;
    --shadow: rgba(0, 0, 0, 0.1);
    --btn-secondary-bg: #ffffff;
    --btn-secondary-border: #d1d3d5;
    --btn-secondary-text: #757a82;
    --pager-bg: #ffffff;
    --pager-hover: #f1f5f9;
}

/* تعريف المتغيرات للوضع المظلم */
body.dark-version {
    --bg-card: #1e1e2f;
    --bg-header: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d2d44;
    --input-bg: #2a2a3a;
    --input-border: #3d3d5c;
    --input-text: #e2e8f0;
    --stat-bg: #25253a;
    --stat-border: #3d3d5c;
    --hover-bg: #25253a;
    --shadow: rgba(0, 0, 0, 0.3);
    --btn-secondary-bg: #2a2a3a;
    --btn-secondary-border: #3d3d5c;
    --btn-secondary-text: #cbd5e1;
    --pager-bg: #2a2a3a;
    --pager-hover: #3d3d5c;
}

/* ========== الأنماط الأساسية ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Kufi Arabic', sans-serif;
}

/* ========== الهيدر الرئيسي ========== */
.page-header {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--shadow);
    padding: 10px;
    margin-bottom: 2rem;
    border-right: 4px solid #4361ee;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-right: 10px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff9a00 0%, #ff6a00 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.header-title h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 20px 0 20px;
    background: var(--stat-bg);
    border-radius: 12px;
    border: 1px solid var(--stat-border);
    transition: transform 0.2s ease;
}

    .stat-item:hover {
        transform: translateY(-2px);
    }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
   /* color: white;*/
    font-size: 1.25rem;
}

    .stat-icon.primary {
        background: #4361ee;
    }

    .stat-icon.success {
        background: #10b981;
    }

    .stat-icon.warning {
        background: #f59e0b;
    }

    .stat-icon.info {
        background: #06b6d4;
    }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: #768191;
}

/* ========== بطاقة البحث ========== */
.filter-card,
.table-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    border: 1px solid var(--btn-secondary-border);
}

.filter-header,
.table-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 10px 10px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
}

.filter-icon,
.table-icon {
    width: 35px;
    height: 35px;
    background: #4361ee;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.filter-header h5,
.table-header h5 {
    margin: 0;
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #3b64aa;
}

.filter-body {
    padding: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 5px;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #3b64aa;
    margin-bottom: 0.25rem;
}

.modern-input,
.modern-select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

    .modern-input:focus,
    .modern-select:focus {
        outline: none;
        border-color: #4361ee;
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    }

    .modern-input::placeholder {
        color: var(--text-muted);
    }

.filter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ========== الأزرار ========== */
.btn-modern {
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #4361ee 0%, #3a56e4 100%);
    color: white;
}

    .btn-primary-modern:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    }

.btn-secondary-modern {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
}

    .btn-secondary-modern:hover {
        background: var(--hover-bg);
        transform: translateY(-1px);
    }

.btn-success-modern {
    background: linear-gradient(135deg, #10b981 0%, #0da271 100%);
    color: white;
}

    .btn-success-modern:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

.btn-outline-modern {
    background: transparent;
    color: #4361ee;
    border: 1px solid #4361ee;
}

    .btn-outline-modern:hover {
        background: rgba(67, 97, 238, 0.1);
        transform: translateY(-1px);
    }

/* ========== الجدول ========== */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

    .modern-table thead {
        background: var(--bg-header);
    }

    .modern-table th {
        padding: 0.75rem 1rem;
        text-align: right;
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-color);
    }

    .modern-table td {
        border-bottom: 1px solid var(--border-color);
        color: var(--text-primary);
        font-size: 12px;
        vertical-align: middle;
        padding-right: 2px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .modern-table tbody tr {
        transition: all 0.2s ease;
    }

        .modern-table tbody tr:hover {
            background: var(--hover-bg);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px var(--shadow);
        }

/* ========== معلومات المشروع ========== */
.project-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.company-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.city {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.project-owner,
.work-type,
.date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.request-id strong {
    color: #4361ee;
    font-size: 0.9rem;
}

/* ========== البادجات ========== */
.status-badge,
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

    .status-badge::before,
    .priority-badge::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
    }

    /* ألوان الحالات */
    .status-badge.bg-new {
        background: #dbeafe;
        color: #1d4ed8;
    }

        .status-badge.bg-new::before {
            background: #1d4ed8;
        }

    .status-badge.bg-pending {
        background: #fef3c7;
        color: #d97706;
    }

        .status-badge.bg-pending::before {
            background: #d97706;
        }

    .status-badge.bg-under-review {
        background: rgba(246, 234, 47, 0.15);
        color: #e0902c;
        border: 1px solid #ecbc7f69;
    }

        .status-badge.bg-under-review::before {
            background: #e0902c;
        }

    .status-badge.bg-approved {
        background: rgba(74, 220, 53, 0.15);
        color: #16a34a;
        border: 1px solid #7fec8b69;
    }

        .status-badge.bg-approved::before {
            background: #16a34a;
        }

    .status-badge.bg-completed {
        background: #dcfce7;
        color: #16a34a;
    }

        .status-badge.bg-completed::before {
            background: #16a34a;
        }

    .status-badge.bg-rejected {
        background: rgba(220, 53, 69, 0.15);
        color: #dc2626;
        border: 1px solid #ec7f7f69;
    }

        .status-badge.bg-rejected::before {
            background: #dc2626;
        }

    /* ألوان الأولويات */
    .priority-badge.bg-high {
        color: #e75837;
        border: 1px solid #e75837;
    }

        .priority-badge.bg-high::before {
            background: #e75837;
        }

    .priority-badge.bg-medium {
        color: #16a34a;
        border: 1px solid #16a34a;
    }

        .priority-badge.bg-medium::before {
            background: #16a34a;
        }

    .priority-badge.bg-low {
        color: #e5947b;
        border: 1px solid #e5947b;
    }

        .priority-badge.bg-low::before {
            background: #e5947b;
        }

/* ========== أزرار الإجراءات ========== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #8ebff4;
}

    .btn-view:hover {
        background: #bfdbfe;
        transform: translateY(-1px);
    }

.btn-review {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #e0902c;
}

    .btn-review:hover {
        background: #fde68a;
        transform: translateY(-1px);
    }

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #ec7f7f;
}

    .btn-delete:hover {
        background: #fecaca;
        transform: translateY(-1px);
    }

/* ========== ترقيم الصفحات ========== */
.grid-pager {
    padding: 1rem;
    text-align: center;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
}

    .grid-pager a,
    .grid-pager span {
        display: inline-block;
        padding: 0.4rem 0.8rem;
        margin: 0 0.2rem;
        border-radius: 8px;
        font-size: 0.8rem;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .grid-pager a {
        background: var(--pager-bg);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

        .grid-pager a:hover {
            background: var(--pager-hover);
            border-color: #4361ee;
            color: #4361ee;
        }

    .grid-pager span.current-page {
        background: #4361ee;
        color: white;
        border: none;
    }

/* ========== حالة فارغة ========== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========== تأثيرات الحركة ========== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== التجاوب للشاشات الصغيرة ========== */
@media (max-width: 992px) {
    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-title {
        justify-content: center;
    }

    .header-stats {
        justify-content: center;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        justify-content: center;
    }

    .table-header {
        flex-direction: column;
        text-align: center;
    }

    .table-info {
        justify-content: center;
    }

    .modern-table {
        display: block;
        overflow-x: auto;
        font-size: 0.8rem;
    }

        .modern-table th,
        .modern-table td {
            white-space: nowrap;
        }

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stat-item {
        padding: 0.5rem 1rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .filter-header, .table-header {
        padding: 0.75rem 1rem;
    }

    .filter-body {
        padding: 1rem;
    }
}


