
/* Animation for status update */
@keyframes statusUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.status-updated {
    font-weight: bold;
    animation: statusUpdate 0.5s ease-in-out;
    transition: all 0.3s ease;
}
.swf-dashboard,
.swf-orders {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
}

.swf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.swf-header h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.swf-header h1 .dashicons {
    color: #0073aa;
    margin-right: 10px;
    vertical-align: middle;
}

/* إحصائيات */
.swf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    border-left: 4px solid;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.stat-total {
    border-left-color: #0073aa;
}

.stat-card.stat-revenue {
    border-left-color: #46b450;
}

.stat-card.stat-today {
    border-left-color: #ffb900;
}

.stat-card.stat-today-revenue {
    border-left-color: #dc3232;
}

.stat-icon {
    font-size: 36px;
    margin-right: 15px;
    color: #666;
}

.stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #333;
}

.stat-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* إحصائيات الحالة */
.swf-status-stats {
    margin-bottom: 30px;
}

.status-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.status-stat {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
}

.status-stat .count {
    display: block;
    font-size: 32px;
    margin-bottom: 5px;
}

.status-stat .label {
    font-size: 14px;
    opacity: 0.9;
}

.status-pending { background: #ffb900; }
.status-processing { background: #0073aa; }
.status-on-hold { background: #7356f1; }
.status-completed { background: #46b450; }
.status-cancelled { background: #dc3232; }

/* إجراءات سريعة */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-action:hover {
    background: #0073aa;
    color: #fff;
    border-color: #005a87;
    transform: translateY(-2px);
}

.quick-action .dashicons {
    font-size: 36px;
    margin-bottom: 10px;
    width: auto;
    height: auto;
}

/* الجداول */
.swf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.swf-table thead {
    background: #f8f9fa;
}

.swf-table th {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #333;
}

.swf-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.swf-table tr:hover td {
    background: #f8f9fa;
}

/* الفلترة */
.swf-orders-filter {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* حالة الطلب */
.order-status-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
}

.order-status-select:focus {
    border-color: #0073aa;
    outline: none;
}

/* أزرار الإجراءات */
.order-actions {
    display: flex;
    gap: 5px;
}

.button-small {
    padding: 4px 8px;
    font-size: 12px;
    min-height: 28px;
    line-height: 1;
}

/* تفاصيل الطلب */
.order-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 5px;
}

.order-details .details-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* الترقيم الصفحي */
.swf-pagination {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.swf-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
}

.swf-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.swf-pagination .page-numbers:hover:not(.current) {
    background: #f8f9fa;
}

/* المودال */
.swf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.swf-modal .modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-header .close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* رسائل التنبيه */
.swf-access-denied {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px;
    border: 1px solid #f5c6cb;
}

.no-orders {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-orders .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .swf-stats-grid,
    .status-stats-grid,
    .quick-actions-grid,
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .swf-header {
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-msg {
        margin-top: 10px;
    }
    
    .order-actions {
        flex-wrap: wrap;
    }
    
    .swf-table {
        display: block;
        overflow-x: auto;
    }
}

/* الرسوم المتحركة */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.swf-dashboard,
.swf-orders {
    animation: fadeIn 0.5s ease;
}

/* تحسينات إضافية */
.order-status-select option {
    padding: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* تحميل */
.spinner {
    display: inline-block;
    background: url('../images/spinner.gif') no-repeat;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}



/* الإشعار الأساسي */
.swf-notice.notice.notice-success.is-dismissible {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    padding: 25px 30px;
    margin: 0;
    border-left: 4px solid #46b450;
    background: #ffffff;
    color: #1e561f;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-width: 400px;
    max-width: 600px;
    animation: swf-notice-fadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #d1e3d1;
}

/* طبقة الخلفية المعتمة */
.swf-notice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    animation: swf-overlay-fadeIn 0.3s ease-out;
}

/* محتوى الإشعار */
.swf-notice-content {
    flex: 1;
    padding-right: 30px;
}

/* عنوان الإشعار */
.swf-notice-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #2a7d2a;
    display: flex;
    align-items: center;
}

.swf-notice-title:before {
    content: "✓";
    display: inline-block;
    margin-right: 10px;
    background: #46b450;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
}

/* نص الإشعار */
.swf-notice-message {
    margin: 0;
    color: #3c763d;
}

/* زر الإغلاق (Dismiss) */
.swf-notice.notice.notice-success.is-dismissible .notice-dismiss {
    position: static;
    top: auto;
    right: auto;
    border: none;
    margin: 0;
    padding: 8px;
    background: #f8f8f8;
    color: #72777c;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.swf-notice.notice.notice-success.is-dismissible .notice-dismiss:before {
    content: "×";
    font: normal 20px/1 Arial, sans-serif;
    font-weight: bold;
    speak: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.swf-notice.notice.notice-success.is-dismissible .notice-dismiss:hover {
    background: #ff4444;
    color: white;
    transform: scale(1.1);
}

/* أزرار إضافية (اختياري) */
.swf-notice-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.swf-notice-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.swf-notice-button-primary {
    background: #46b450;
    color: white;
}

.swf-notice-button-primary:hover {
    background: #389e41;
}

.swf-notice-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.swf-notice-button-secondary:hover {
    background: #e0e0e0;
}

/* أنيميشن الظهور */
@keyframes swf-notice-fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes swf-overlay-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* أنيميشن الإغلاق */
.swf-notice.notice.notice-success.is-dismissible.closing {
    animation: swf-notice-fadeOut 0.3s ease-out forwards;
}

.swf-notice-overlay.closing {
    animation: swf-overlay-fadeOut 0.3s ease-out forwards;
}

@keyframes swf-notice-fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
}

@keyframes swf-overlay-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* تصميم متجاوب */
@media screen and (max-width: 768px) {
    .swf-notice.notice.notice-success.is-dismissible {
        min-width: 90%;
        max-width: 90%;
        padding: 20px;
        margin: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .swf-notice-content {
        padding-right: 0;
        margin-bottom: 20px;
    }
    
    .swf-notice.notice.notice-success.is-dismissible .notice-dismiss {
        align-self: flex-end;
    }
    
    .swf-notice-actions {
        flex-direction: column;
    }
    
    .swf-notice-button {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .swf-notice.notice.notice-success.is-dismissible {
        padding: 15px;
        min-width: 85%;
        max-width: 85%;
    }
    
    .swf-notice-title {
        font-size: 16px;
    }
    
    .swf-notice-message {
        font-size: 14px;
    }
}

/* إصدار بديل بتصميم دائري */
.swf-notice-circle-icon {
    width: 60px;
    height: 60px;
    background: #46b450;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    flex-shrink: 0;
}

.swf-notice-circle-icon:before {
    content: "✓";
    color: white;
    font-size: 28px;
    font-weight: bold;
}