/* تنسيق عام للواجهة */
.wrap {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    color: #0073aa;
    margin-bottom: 20px;
}

/* حقول البحث */
#search-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.search-field {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-field label {
    font-weight: bold;
    color: #333;
}

.search-field input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-field input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}

.search-field button {
    padding: 10px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.search-field button:hover {
    background-color: #005177;
}

/* نتائج البحث */
#results {
    margin-top: 20px;
}

#results ul {
    list-style: none;
    padding: 0;
}

#results ul li {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

#results ul li:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#results ul li .user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#results ul li .user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#results ul li .user-actions form {
    margin: 0;
}

#results ul li .user-actions form input[type="submit"] {
    background-color: #d63638;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#results ul li .user-actions form input[type="submit"]:hover {
    background-color: #c82333;
}

#results ul li .user-actions form input[type="submit"].reset-password {
    background-color: #28a745;
}

#results ul li .user-actions form input[type="submit"].reset-password:hover {
    background-color: #218838;
}

/* تنسيق الجدول */
#results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#results table th,
#results table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#results table th {
    background-color: #f9f9f9;
    font-weight: bold;
    color: #333;
}

#results table tr:hover {
    background-color: #f1f1f1;
}

#results table .user-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#results table .user-actions form {
    margin: 0;
}

#results table .user-actions form input[type="submit"] {
    background-color: #d63638;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#results table .user-actions form input[type="submit"]:hover {
    background-color: #c82333;
}

#results table .user-actions form input[type="submit"].reset-password {
    background-color: #28a745;
}

#results table .user-actions form input[type="submit"].reset-password:hover {
    background-color: #218838;
}

/* تنسيق البراندنج */
.branding {
    padding: 15px;
    background-color: #f1f1f1;
    border-top: 1px solid #ddd;
    margin-top: 30px;
    font-size: 14px;
    color: #666;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.branding p {
    display: flex;
    /* استخدام Flexbox للمحاذاة الأفقية */
    align-items: center;
    /* محاذاة العناصر عموديًا في المنتصف */
    justify-content: center;
    /* توسيط العناصر أفقيًا */
    gap: 8px;
    /* المسافة بين النص واللوجو */
}

.branding a.go-net-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    color: #0073aa;
    transition: color 0.3s ease;
}

.branding a.go-net-link:hover {
    color: #005177;
}

.branding .go-net-logo {
    width: auto;
    /* جعل العرض تلقائيًا */
    height: 30px;
    /* جعل الارتفاع متناسبًا مع حجم النص */
    vertical-align: middle;
    /* محاذاة عمودية في المنتصف */
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 480px) {
    .search-field {
        flex: 1 1 100%;
    }

    .search-field button {
        width: 100%;
    }
}

@media (min-width: 600px) {
    .search-field {
        flex: 1 1 calc(50% - 15px);
    }
}

@media (min-width: 900px) {
    .search-field {
        flex: 1 1 calc(25% - 15px);
    }
}

/* تنسيق Select2 */
.select2-container {
    width: 100% !important;
    margin-bottom: 15px;
}

.select2-selection--multiple {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 5px !important;
}

.select2-selection__choice {
    background-color: #0073aa !important;
    border: none !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
}

.select2-selection__choice__remove {
    color: white !important;
    margin-right: 5px !important;
}

/* تنسيق زر إلغاء الطلب */
#results ul li .user-actions form input[type="submit"].cancel-order {
    background-color: #ffc107;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#results ul li .user-actions form input[type="submit"].cancel-order:hover {
    background-color: #e0a800;
}

/* Moved from inline CSS */
.advanced-search-wrap {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    direction: rtl;
    font-family: Arial, sans-serif;
}

.advanced-search-wrap h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.search-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-field label {
    font-weight: bold;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-field input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

.search-button {
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.search-button:hover {
    background-color: #0056b3;
}

.results-container {
    margin-top: 20px;
}

.user-result {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-info h2,
.user-orders h2 {
    font-size: 1.5em;
    color: #007bff;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.user-details p,
.order-details p {
    margin: 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.label {
    font-weight: bold;
    color: #333;
    margin-left: 5px;
}

.user-actions,
.order-actions,
.coupon-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.action-button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reset-password-button {
    background-color: #28a745;
}

.reset-password-button:hover {
    background-color: #218838;
}

.cancel-order-button {
    background-color: #dc3545;
}

.cancel-order-button:hover {
    background-color: #c82333;
}

.delete-coupon-button {
    background-color: #dc3545;
}

.delete-coupon-button:hover {
    background-color: #c82333;
}

.user-orders ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.coupon-result {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.coupon-result p {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading {
    text-align: center;
    font-size: 1.2em;
    color: #007bff;
    padding: 20px;
}

.no-results,
.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.branding {
    text-align: center;
    margin-top: 30px;
    color: #666;
}

.branding img {
    max-width: 100px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .advanced-search-wrap {
        padding: 10px;
    }

    .search-container {
        grid-template-columns: 1fr;
    }

    .search-field {
        padding: 10px;
    }

    .user-details,
    .order-details {
        grid-template-columns: 1fr;
    }

    .order-item {
        flex-direction: column;
        align-items: stretch;
    }

    .user-actions,
    .order-actions,
    .coupon-actions {
        justify-content: center;
    }

    .action-button {
        width: 100%;
        max-width: 200px;
        margin: 10px auto;
    }
}


/* Moved from inline CSS */
.advanced-search-wrap {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    direction: rtl;
    font-family: Arial, sans-serif;
}

.advanced-search-wrap h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.search-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-field label {
    font-weight: bold;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-field input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

.search-button {
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.search-button:hover {
    background-color: #0056b3;
}

.results-container {
    margin-top: 20px;
}

.user-result {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-info h2,
.user-orders h2 {
    font-size: 1.5em;
    color: #007bff;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.user-details p,
.order-details p {
    margin: 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.label {
    font-weight: bold;
    color: #333;
    margin-left: 5px;
}

.user-actions,
.order-actions,
.coupon-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.action-button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.reset-password-button {
    background-color: #28a745;
}

.reset-password-button:hover {
    background-color: #218838;
}

.cancel-order-button {
    background-color: #dc3545;
}

.cancel-order-button:hover {
    background-color: #c82333;
}

.delete-coupon-button {
    background-color: #dc3545;
}

.delete-coupon-button:hover {
    background-color: #c82333;
}

.user-orders ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.coupon-result {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.coupon-result p {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading {
    text-align: center;
    font-size: 1.2em;
    color: #007bff;
    padding: 20px;
}

.no-results,
.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.branding {
    text-align: center;
    margin-top: 30px;
    color: #666;
}

.branding img {
    max-width: 100px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .advanced-search-wrap {
        padding: 10px;
    }

    .search-container {
        grid-template-columns: 1fr;
    }

    .search-field {
        padding: 10px;
    }

    .user-details,
    .order-details {
        grid-template-columns: 1fr;
    }

    .order-item {
        flex-direction: column;
        align-items: stretch;
    }

    .user-actions,
    .order-actions,
    .coupon-actions {
        justify-content: center;
    }

    .action-button {
        width: 100%;
        max-width: 200px;
        margin: 10px auto;
    }

    /* Responsive Tables */
    .wp-list-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Responsive Modals */
    .modal-content {
        width: 90% !important;
        margin: 20% auto !important;
    }

    /* Stack stats cards */
    .stats-overview {
        flex-direction: column;
    }

    .stat-card {
        margin-bottom: 10px;
    }
}

/* ===================== Dark Mode ===================== */
body.dark-mode {
    background-color: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #wpcontent,
body.dark-mode #wpbody-content {
    background-color: #1a1a2e !important;
}

body.dark-mode .advanced-search-wrap,
body.dark-mode .wrap {
    background-color: #16213e !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode h1,
body.dark-mode .advanced-search-wrap h1 {
    color: #64b5f6 !important;
}

/* Dark Mode - Nav Tabs */
body.dark-mode .nav-tab-wrapper {
    border-bottom-color: #2a2a4a !important;
}

body.dark-mode .nav-tab {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
    color: #aaa !important;
}

body.dark-mode .nav-tab:hover {
    background: #2a2a4a !important;
    color: #fff !important;
}

body.dark-mode .nav-tab-active,
body.dark-mode .nav-tab-active:hover {
    background: #16213e !important;
    border-bottom-color: #16213e !important;
    color: #64b5f6 !important;
}

/* Dark Mode - Search Fields */
body.dark-mode .search-field {
    background: #1a1a2e !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #2a2a4a;
}

body.dark-mode .search-field label {
    color: #b0b0b0 !important;
}

body.dark-mode .search-field input {
    background-color: #0f3460 !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .search-field input::placeholder {
    color: #777 !important;
}

body.dark-mode .search-field input:focus {
    border-color: #64b5f6 !important;
    box-shadow: 0 0 8px rgba(100, 181, 246, 0.4) !important;
}

body.dark-mode .search-button {
    background-color: #1a73e8 !important;
}

body.dark-mode .search-button:hover {
    background-color: #1565c0 !important;
}

/* Dark Mode - Results */
body.dark-mode .user-result,
body.dark-mode .coupon-result {
    background: #1a1a2e !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #2a2a4a;
}

body.dark-mode .user-details p,
body.dark-mode .order-details p {
    background: #0f3460 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .label {
    color: #90caf9 !important;
}

body.dark-mode .user-info h2,
body.dark-mode .user-orders h2 {
    color: #64b5f6 !important;
}

body.dark-mode .user-main-info {
    border-bottom-color: #2a2a4a !important;
}

/* Dark Mode - Orders */
body.dark-mode .order-item {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}

/* Dark Mode - Coupon Details */
body.dark-mode .coupon-details-card {
    background: #0f3460 !important;
    border-color: #1a73e8 !important;
}

body.dark-mode .coupon-details-card h3 {
    color: #64b5f6 !important;
}

body.dark-mode .coupon-details-card p {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

/* Dark Mode - Stats Cards */
body.dark-mode .stat-card {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .stat-card h3 {
    color: #b0b0b0 !important;
}

/* Dark Mode - Tables */
body.dark-mode .recent-activities {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .recent-activities h3 {
    color: #e0e0e0 !important;
}

body.dark-mode .wp-list-table,
body.dark-mode table {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .wp-list-table th,
body.dark-mode table th {
    background-color: #0f3460 !important;
    color: #90caf9 !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .wp-list-table td,
body.dark-mode table td {
    color: #e0e0e0 !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .wp-list-table tr:hover,
body.dark-mode table tr:hover {
    background-color: #1a2744 !important;
}

body.dark-mode .wp-list-table.striped tbody tr:nth-child(odd) {
    background-color: #0f3460 !important;
}

/* Dark Mode - Buttons */
body.dark-mode .button,
body.dark-mode .button-secondary {
    background: #2a2a4a !important;
    border-color: #3a3a5a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .button:hover,
body.dark-mode .button-secondary:hover {
    background: #3a3a5a !important;
    color: #fff !important;
}

body.dark-mode .button-primary {
    background: #1a73e8 !important;
    border-color: #1565c0 !important;
    color: #fff !important;
}

body.dark-mode .button-primary:hover {
    background: #1565c0 !important;
}

/* Dark Mode - Toggle Button */
body.dark-mode #dark-mode-toggle {
    background: #e8a820 !important;
    border-color: #d4951a !important;
    color: #1a1a2e !important;
}

body.dark-mode #dark-mode-toggle:hover {
    background: #f0b830 !important;
}

/* Dark Mode - Reports Controls */
body.dark-mode #stats-period {
    background: #0f3460 !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

body.dark-mode #reports-controls span {
    color: #b0b0b0 !important;
}

/* Dark Mode - Modal */
body.dark-mode .modal-content {
    background-color: #16213e !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .modal-content h2 {
    color: #64b5f6 !important;
}

body.dark-mode .modal-content label {
    color: #b0b0b0 !important;
}

body.dark-mode .modal-content input {
    background: #0f3460 !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .close-modal {
    color: #888 !important;
}

body.dark-mode .close-modal:hover {
    color: #ff6b6b !important;
}

/* Dark Mode - Branding */
body.dark-mode .branding {
    background-color: #0f0f23 !important;
    border-top-color: #2a2a4a !important;
    color: #777 !important;
}

/* Dark Mode - Pagination */
body.dark-mode .pagination-btn {
    background: #0f3460 !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .pagination-btn:hover {
    background: #1a73e8 !important;
}

/* Dark Mode - Loading & Errors */
body.dark-mode .loading {
    color: #64b5f6 !important;
}

body.dark-mode .no-results,
body.dark-mode .error {
    color: #ff6b6b !important;
}

/* Dark Mode - Scrollbar */
body.dark-mode ::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1a1a2e;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #2a2a4a;
    border-radius: 4px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #3a3a5a;
}

/* تنسيق الطباعة */
@media print {

    #adminmenumain,
    #wpadminbar,
    #adminmenuwrap,
    #wpfooter,
    .branding,
    .nav-tab-wrapper,
    #reports-controls {
        display: none !important;
    }

    #wpcontent,
    #wpbody-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .advanced-search-wrap,
    #reports-container {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    body {
        background: #fff !important;
    }

    .stats-overview {
        flex-wrap: wrap;
    }

    .stat-card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        flex: 1 1 30% !important;
    }

    .user-actions,
    .order-actions {
        display: none !important;
    }
}