/* Submit Articles & WhatsApp Notifications - Modern RTL Stylesheet */
/* Author: Yazeed Nasser */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

.saw-container {
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
    direction: rtl;
    text-align: right;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px auto !important;
    padding: 0 !important;
    box-sizing: border-box;
    color: #0f172a;
}

.saw-container * {
    box-sizing: border-box;
}

.saw-card-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 15px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
}

.saw-card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.saw-header {
    text-align: center;
    margin-bottom: 30px;
}

.saw-icon-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #10b981;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.2);
}

.saw-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
}

.saw-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* Strict Isolation for Buttons & Inputs to avoid Theme CSS conflicts */
.saw-container button {
    font-family: 'Tajawal', sans-serif;
    outline: none;
}

/* Tabs Navigation - Premium Segmented Switch */
.saw-tabs-nav {
    display: flex;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 28px;
}

.saw-container .saw-tab-btn {
    flex: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 18px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.saw-container .saw-tab-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.6) !important;
}

.saw-container .saw-tab-btn.saw-tab-active {
    background: #ffffff !important;
    color: #059669 !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.saw-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
}

/* Form Styles */
.saw-alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

.saw-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.saw-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.saw-form-group {
    margin-bottom: 22px;
}

.saw-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.saw-input,
.saw-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
    transition: all 0.2s ease;
}

.saw-input:focus,
.saw-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.saw-textarea {
    resize: vertical;
    min-height: 140px;
}

.saw-hint {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.saw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.saw-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.35);
}

.saw-btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px rgba(16, 185, 129, 0.45);
}

.saw-btn-secondary {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #cbd5e1;
}

.saw-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}

.saw-file-upload-box {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saw-file-upload-box:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.saw-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.saw-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.saw-user-welcome {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saw-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.saw-actions .saw-btn-secondary {
    width: 35%;
}

.saw-actions .saw-btn-primary {
    width: 65%;
}

/* Success Screen */
.saw-success-card {
    text-align: center;
    padding: 20px 10px;
}

.saw-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -5px rgba(22, 163, 74, 0.25);
}

.saw-success-card h3 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.saw-success-card p {
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ========================================================= */
/* AL-MURSIL STYLE STEPPER & PROGRESS TIMELINE (4 STEPS)    */
/* ========================================================= */

.saw-articles-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.saw-article-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.saw-latest-article-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
    border: 2px solid #a7f3d0 !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15) !important;
    position: relative !important;
}

.saw-latest-badge {
    display: inline-block;
    background: #10b981;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.saw-article-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.saw-article-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.saw-article-card-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.4;
}

.saw-article-date {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.saw-status-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.saw-status-pending {
    background: #fef3c7;
    color: #d97706;
}

.saw-status-publish {
    background: #dcfce7;
    color: #15803d;
}

.saw-status-draft,
.saw-status-trash {
    background: #fee2e2;
    color: #b91c1c;
}

/* Stepper Bar Container */
.saw-stepper-wrapper {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 25px 0 10px;
    padding: 0 10px;
}

/* Stepper Connecting Track */
.saw-stepper-track {
    position: absolute;
    top: 17px;
    left: 45px;
    right: 45px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
    border-radius: 2px;
}

.saw-stepper-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Step Nodes */
.saw-step-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.saw-step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #cbd5e1;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* Completed Step (Green Circle + Glow) */
.saw-step-node.completed .saw-step-icon {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Active Pulsing Step */
.saw-step-node.active-pulse .saw-step-icon {
    background: #ffffff;
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.2);
}

.saw-spinner-ring {
    width: 14px;
    height: 14px;
    border: 2.5px solid #10b981;
    border-top-color: transparent;
    border-radius: 50%;
    animation: sawSpin 1s linear infinite;
}

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

/* Failed / Rejected Step */
.saw-step-node.failed .saw-step-icon {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.saw-step-title {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.saw-step-node.completed .saw-step-title {
    color: #059669;
}

.saw-step-node.active-pulse .saw-step-title {
    color: #047857;
    font-weight: 800;
}

.saw-step-node.failed .saw-step-title {
    color: #dc2626;
    font-weight: 800;
}

/* Permalink Link Button */
.saw-article-action {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.saw-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.saw-link-btn:hover {
    background: #d1fae5;
    color: #047857;
    transform: translateY(-1px);
}

/* Rejection Reason Box */
.saw-rejection-reason-box {
    margin-top: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 14px 18px;
}

.saw-rejection-title {
    font-weight: 800;
    font-size: 14px;
    color: #991b1b;
    margin-bottom: 4px;
}

.saw-rejection-body {
    font-size: 13px;
    color: #7f1d1d;
    line-height: 1.5;
}

.saw-empty-state,
.saw-loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}
