/* requests.css - أنماط صفحة الطلبات */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.34;
    min-height: 100vh;
    padding-bottom: 70px;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #1e1e2f;
    color: #eee;
}
body.dark-mode .top-header,
body.dark-mode .requests-container,
body.dark-mode .request-card,
body.dark-mode .bottom-nav-bar,
body.dark-mode .auth-modal-content,
body.dark-mode .account-modal-content,
body.dark-mode .admin-panel-content,
body.dark-mode .pending-properties-content,
body.dark-mode .contact-content,
body.dark-mode .saved-content,
body.dark-mode .modal-content,
body.dark-mode .sidebar {
    background-color: #2d2d3a;
    color: #eee;
    border-color: #444;
}
body.dark-mode .filter-select,
body.dark-mode .btn-outline,
body.dark-mode .auth-btn,
body.dark-mode .account-btn,
body.dark-mode .close-btn,
body.dark-mode .request-action-btn,
body.dark-mode .sidebar-action-btn,
body.dark-mode .auth-sidebar-btn {
    background-color: #3a3a4a;
    color: #eee;
    border-color: #555;
}
body.dark-mode .nav-item {
    color: #aaa;
}
body.dark-mode .nav-item.active {
    color: #1877f2;
}

/* فلتر نطاق رقم الطلب */
.range-filter {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f0f2f5;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.range-filter label {
    font-size: 13px;
    color: #65676b;
    font-weight: 500;
}

.range-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #dddfe2;
    border-radius: 5px;
    font-size: 13px;
    text-align: center;
    background: white;
}

.range-input:focus {
    outline: none;
    border-color: #1877f2;
}

/* رقم الطلب في الكارد */
.request-id {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    font-weight: 500;
}

/* تحسين عرض الفلاتر على الشاشات الصغيرة */
@media (max-width: 768px) {
    .range-filter {
        width: 100%;
        justify-content: space-between;
    }
    .range-input {
        width: 60px;
    }
}


/* الشريط العلوي */
.top-header {
    position: sticky;
    top: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #dddfe2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo {
    font-size: clamp(24px, 6vw, 28px);
    color: #1877f2;
}

.site-title {
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    color: #1877f2;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #1877f2;
    color: white;
}

.btn-primary:hover {
    background-color: #166fe5;
}

.btn-outline {
    background-color: #f0f2f5;
    color: #65676b;
}

.btn-outline:hover {
    background-color: #e4e6eb;
}

#toggleSidebarBtn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #65676b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

#toggleSidebarBtn:hover {
    background-color: #f0f2f5;
    color: #1877f2;
}

/* القائمة الجانبية */
.sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(50vh - 60px);
    background: #fff;
    border-left: 1px solid #dddfe2;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #dddfe2;
}

.sidebar-header h3 {
    font-size: 1.125rem;
    color: #1877f2;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #65676b;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #1c1e21;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9375rem;
}

.sidebar-menu a i {
    width: 20px;
    color: #1877f2;
    font-size: 1.125rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f0f2f5;
}

.sidebar-actions {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
}

.sidebar-actions h4 {
    margin-bottom: 10px;
    color: #1877f2;
    font-size: 0.95rem;
}

.sidebar-action-btn {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    border: none;
    border-radius: 5px;
    background: #f0f2f5;
    color: #1c1e21;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.sidebar-action-btn:hover {
    background: #e4e6eb;
}

.auth-sidebar-buttons {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-sidebar-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    width: 100%;
}

.auth-sidebar-btn.login {
    background: #1877f2;
    color: white;
}

.auth-sidebar-btn.register {
    background: #42b72a;
    color: white;
}

.auth-sidebar-btn.logout {
    background: #e74c3c;
    color: white;
}

.auth-sidebar-btn.admin {
    background: #9b59b6;
    color: white;
}

/* المحتوى الرئيسي */
.requests-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1877f2;
    font-size: clamp(20px, 5vw, 28px);
}

/* تبويبات الطلبات */
.requests-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #65676b;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f0f2f5;
}

.tab-btn.active {
    background: #1877f2;
    color: white;
}

/* شريط الفلاتر */
.requests-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

#searchRequest {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    background: #f0f2f5;
    font-size: 14px;
    outline: none;
}

#searchRequest:focus {
    border-color: #1877f2;
    background: white;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    background: #f0f2f5;
    font-size: 14px;
    color: #1c1e21;
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #1877f2;
    background: white;
}

/* قائمة الطلبات */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.request-card {
    background: white;
    border: 1px solid #dddfe2;
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.request-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.request-price {
    font-size: 18px;
    font-weight: 700;
    color: #1877f2;
}

.request-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.request-status.pending {
    background: #fff3cd;
    color: #856404;
}

.request-status.approved {
    background: #d4edda;
    color: #155724;
}

.request-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

.request-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.request-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #65676b;
}

.request-detail-item i {
    width: 16px;
    color: #1877f2;
}

.request-detail-item a {
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
}

.request-detail-item a:hover {
    text-decoration: underline;
}

.request-notes {
    background: #f0f2f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #1c1e21;
    margin-bottom: 12px;
}

.request-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.request-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.request-action-btn.view {
    background: #f0f2f5;
    color: #65676b;
}

.request-action-btn.approve {
    background: #d4edda;
    color: #155724;
}

.request-action-btn.reject {
    background: #f8d7da;
    color: #721c24;
}

.request-action-btn.delete {
    background: #f8d7da;
    color: #dc3545;
}

.request-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.request-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* رسالة عدم وجود طلبات */
.no-requests {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
}

.no-requests i {
    font-size: 48px;
    color: #bec3c9;
    margin-bottom: 16px;
}

.no-requests h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.no-requests p {
    font-size: 14px;
}

/* الشريط السفلي */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    backdrop-filter: blur(20px);
    border-top: 1px solid #dddfe2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #65676b;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
    border-radius: 8px;
    flex: 1;
    max-width: 70px;
    height: 100%;
}

.nav-item:hover {
    color: #1877f2;
    background-color: #f0f2f5;
}

.nav-item.active {
    color: #1877f2;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e41e3f;
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-only {
    display: none;
}

.admin-only.visible {
    display: flex;
}

/* المودالات */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1877f2;
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.1);
    color: #65676b;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1c1e21;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dddfe2;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1877f2;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* الإشعارات المنبثقة */
.notification {
    position: fixed;
    top: 100px;
    right: 50%;
    transform: translateX(50%);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease;
}

.notification.success { background-color: #e7f6ea; color: #0a7c2f; border: 1px solid #a8e6b9; }
.notification.error { background-color: #fde8e8; color: #c53030; border: 1px solid #fecaca; }
.notification.info { background-color: #e7f3ff; color: #1877f2; border: 1px solid #bbdfff; }

@keyframes slideDown {
    from { transform: translateX(50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(50%) translateY(0); opacity: 1; }
}

/* عنصر التحميل */
.loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 1002;
    display: none;
    text-align: center;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .requests-container {
        margin: 10px;
        padding: 15px;
    }
    .requests-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-select {
        width: 100%;
    }
    .request-details {
        grid-template-columns: 1fr;
    }
    .request-actions {
        flex-direction: column;
    }
    .request-action-btn {
        width: 100%;
        justify-content: center;
    }
}