:root {
    --bg-dark: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.85);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #1f6feb;
    --accent-glow: rgba(88, 166, 255, 0.25);
    --success: #238636;
    --success-glow: rgba(35, 134, 54, 0.35);
    --danger: #da3633;
    --warning: #d29922;

    /* ألوان المنصات */
    --fb-color: #1877f2;
    --ig-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --x-color: #ffffff;
    --li-color: #0a66c2;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 24px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(31, 111, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(204, 35, 102, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1320px;
    margin: 0 auto;
}

/* الرأس العلوي */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 32px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-area h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(35, 134, 54, 0.15);
    border: 1px solid rgba(35, 134, 54, 0.3);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: #3fb950;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #3fb950;
    border-radius: 50%;
    box-shadow: 0 0 10px #3fb950;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* الشبكة الرئيسية للداشبورد */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* الكروت والتصميم الزجاجي */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.card-title h2 {
    font-size: 19px;
    font-weight: 700;
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.badge-counter {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    border-color: rgba(88, 166, 255, 0.3);
}

/* عناصر النموذج */
.form-group {
    margin-bottom: 22px;
}

.section-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.label-with-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-counter {
    font-size: 12px;
    color: var(--text-secondary);
}

/* اختيار المنصات */
.platforms-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.platform-chip input[type="checkbox"] {
    display: none;
}

.chip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.chip-content .icon {
    font-size: 18px;
}

.chip-content .name {
    font-size: 13px;
    font-weight: 600;
    flex-grow: 1;
    margin-right: 8px;
}

.chip-content .check-icon {
    font-size: 12px;
    opacity: 0.3;
    transition: var(--transition);
}

.platform-chip input:checked + .chip-content {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.platform-chip input:checked + .chip-content .check-icon {
    opacity: 1;
    color: #3fb950;
    font-weight: bold;
}

.platform-chip input:checked + .chip-content.facebook { border-color: var(--fb-color); box-shadow: 0 0 12px rgba(24, 119, 242, 0.2); }
.platform-chip input:checked + .chip-content.instagram { border-color: #e6683c; box-shadow: 0 0 12px rgba(220, 39, 67, 0.2); }
.platform-chip input:checked + .chip-content.twitter { border-color: var(--x-color); box-shadow: 0 0 12px rgba(255, 255, 255, 0.2); }
.platform-chip input:checked + .chip-content.linkedin { border-color: var(--li-color); box-shadow: 0 0 12px rgba(10, 102, 194, 0.2); }

/* حقل الاختيار (Select) */
.form-select {
    width: 100%;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select option {
    background: #161b22;
    color: #f0f6fc;
}

/* حقل النص */
textarea {
    width: 100%;
    background: rgba(13, 17, 23, 0.7);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
    outline: none;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* رأس الكابشن وخيار التخصيص */
.caption-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toggle-custom-label input[type="checkbox"] {
    display: none;
}

.custom-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-custom-label input:checked + .custom-badge {
    background: linear-gradient(90deg, #1f6feb, #8957e5);
    color: white;
    border-color: #8957e5;
    box-shadow: 0 0 12px rgba(137, 87, 229, 0.4);
}

.custom-caption-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.caption-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.caption-tab-btn.active, .caption-tab-btn:hover {
    background: rgba(88, 166, 255, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}

.twitter-counter {
    font-weight: 700;
    color: #3fb950;
}

.twitter-counter.warning {
    color: #d29922;
}

.twitter-counter.danger {
    color: #f85149;
}

/* استوديو تحريك وقص الصورة */
.image-studio-container {
    margin-top: 16px;
    padding: 16px;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

.studio-title-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.studio-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.studio-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-apply-crop {
    background: linear-gradient(90deg, #238636, #2ea043);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(35, 134, 54, 0.4);
}

.btn-apply-crop:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(46, 160, 67, 0.6);
}

.cropper-viewport {
    width: 100%;
    height: 340px;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.cropper-viewport img {
    max-width: 100%;
    display: block;
}

.studio-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.studio-ratios {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ctrl-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 4px;
}

.studio-ratio-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.studio-ratio-btn.active, .studio-ratio-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.studio-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

.tool-btn.btn-reset {
    color: var(--text-secondary);
    font-size: 11px;
    margin-right: auto;
}

/* تخصيص إطار Cropper.js ليتماشى مع المظهر الداكن والعصري */
.cropper-view-box {
    outline: 2px solid #58a6ff;
    outline-color: rgba(88, 166, 255, 0.85);
}

.cropper-line {
    background-color: #58a6ff;
}

.cropper-point {
    background-color: #58a6ff;
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.75);
}

/* منطقة رفع الملفات (Dropzone) */
.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.05);
}

.upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.format-hint {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#previewMediaWrapper img, #previewMediaWrapper video {
    max-width: 100%;
    max-height: 260px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
}

.btn-remove-media {
    background: rgba(218, 54, 51, 0.15);
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: #f85149;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-media:hover {
    background: rgba(218, 54, 51, 0.3);
}

/* خيارات التوقيت والجدولة */
.timing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .timing-options {
        grid-template-columns: 1fr;
    }
}

.timing-radio input[type="radio"] {
    display: none;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.radio-card .radio-icon {
    font-size: 24px;
}

.radio-card strong {
    display: block;
    font-size: 14px;
}

.radio-card p {
    font-size: 11px;
    color: var(--text-secondary);
}

.timing-radio input:checked + .radio-card {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.schedule-inputs {
    margin-top: 14px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.schedule-inputs label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent);
}

.schedule-inputs input[type="datetime-local"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

/* زر النشر الرئيسي */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(90deg, #1f6feb, #238636);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(31, 111, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(35, 134, 54, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* تنبيه الحالة */
.status-alert {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
}

.status-alert.success {
    background: rgba(35, 134, 54, 0.2);
    border: 1px solid #3fb950;
    color: #3fb950;
}

.status-alert.error {
    background: rgba(218, 54, 51, 0.2);
    border: 1px solid #f85149;
    color: #f85149;
}

/* العمود الجانبي */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* تابات المعاينة */
.preview-tabs {
    display: flex;
    gap: 6px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active, .tab-btn:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

/* بطاقة المعاينة الاجتماعية (Mockup) */
.social-mockup {
    background: #18191a;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.mockup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.mockup-avatar {
    width: 42px;
    height: 42px;
    background: #3a3b3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.mockup-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.mockup-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.mockup-time {
    display: block;
    font-size: 11px;
    color: #b0b3b8;
}

.mockup-body {
    padding: 0 16px 14px;
    font-size: 14px;
    word-break: break-word;
    white-space: pre-wrap;
}

.mockup-media {
    background: #000;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.empty-media-placeholder {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 40px;
    text-align: center;
}

.mockup-media img, .mockup-media video {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
}

.mockup-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: #b0b3b8;
}

.mockup-reactions {
    display: flex;
    gap: 20px;
}

/* تنسيقات المنصات داخل المعاينة */
.social-mockup.twitter-mode {
    border-color: rgba(255, 255, 255, 0.2);
}
.social-mockup.instagram-mode .mockup-avatar {
    border: 2px solid #e1306c;
}

/* قائمة المنشورات المجدولة */
.scheduled-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 340px;
    overflow-y: auto;
}

.scheduled-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition);
}

.scheduled-item:hover {
    border-color: var(--accent);
}

.scheduled-info {
    flex-grow: 1;
}

.scheduled-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.scheduled-snippet {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.scheduled-platforms {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.platform-mini-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.btn-delete-scheduled {
    background: transparent;
    border: none;
    color: #f85149;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-delete-scheduled:hover {
    background: rgba(218, 54, 51, 0.2);
}

.empty-scheduled {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* تنسيق قسم التعليق الأول التلقائي (First Comment) */
.first-comment-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
}

.first-comment-group:hover {
    border-color: rgba(88, 166, 255, 0.3);
}

.first-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.fc-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fc-icon {
    font-size: 22px;
    background: rgba(88, 166, 255, 0.1);
    padding: 6px;
    border-radius: 8px;
    line-height: 1;
}

.fc-title {
    color: var(--text-primary);
    font-size: 14px;
}

.fc-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 3px;
    line-height: 1.4;
}

.first-comment-container {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease;
}

.first-comment-container textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    transition: var(--transition);
    outline: none;
}

.first-comment-container textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.fc-badge-info {
    margin-top: 8px;
    font-size: 11px;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.08);
    padding: 8px 12px;
    border-radius: 6px;
    border-right: 3px solid #58a6ff;
}

/* معاينة التعليق الأول داخل صندوق المعاينة الحية */
.mockup-first-comment {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.mockup-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(88, 166, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.mockup-comment-content {
    flex: 1;
}

.mockup-comment-author {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.mockup-comment-bubble {
    font-size: 12px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 12px;
    border-top-right-radius: 2px;
    line-height: 1.4;
    word-break: break-word;
}

/* تنسيقات زر الإعدادات بالهيدر والتسميات */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-settings-header {
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.35);
    color: #58a6ff;
    padding: 8px 16px;
    border-radius: 24px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-settings-header:hover {
    background: rgba(88, 166, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.btn-manage-pages {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
}

.btn-manage-pages:hover {
    color: #79b8ff;
}

/* نافذة المودال المنبثقة للإعدادات (Settings Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.modal-dialog {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: scaleUp 0.25s ease;
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 26px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-subtitle {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.settings-card-header h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.badge-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    font-weight: 700;
}

.badge-tag.optional {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.settings-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.settings-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.settings-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.btn-action-verify {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-action-verify:hover {
    background: #4791ea;
}

.settings-status-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.settings-status-msg.success {
    background: rgba(35, 134, 54, 0.15);
    border: 1px solid rgba(35, 134, 54, 0.3);
    color: #3fb950;
}

.settings-status-msg.error {
    background: rgba(218, 54, 51, 0.15);
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: #f85149;
}

/* قائمة الصفحات المكتشفة مع التحديد */
.discovered-pages-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

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

.pages-list-header h5 {
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
}

.btn-toggle-all-pages {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.btn-toggle-all-pages:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.pages-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-left: 4px;
}

.page-check-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.page-check-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(88, 166, 255, 0.3);
}

.page-check-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.page-check-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.page-check-details {
    flex: 1;
}

.page-check-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.page-check-ig {
    font-size: 11px;
    color: #e1306c;
    margin-top: 2px;
    display: block;
}

/* حقول Cloudinary */
.cloudinary-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.field-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-item label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.cloudinary-test-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-test-cloud {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-test-cloud:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cloud-status-msg {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.cloud-status-msg.success {
    color: #3fb950;
}

.cloud-status-msg.error {
    color: #f85149;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* تنسيقات قسم الويبهوك ودليل الربط */
.webhook-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.copy-group {
    display: flex;
    gap: 6px;
}

.code-font {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    color: #58a6ff !important;
    direction: ltr;
    text-align: left;
}

.btn-copy-field {
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--accent);
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-copy-field:hover {
    background: var(--accent);
    color: #fff;
}

.btn-copy-field.copied {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

/* الدليل الإرشادي المنسدل */
.setup-guide-details {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.setup-guide-summary {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    background: rgba(255, 255, 255, 0.02);
}

.setup-guide-summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.guide-arrow {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.setup-guide-details[open] .guide-arrow {
    transform: rotate(180deg);
}

.setup-guide-content {
    padding: 16px 20px;
    border-top: 1px solid var(--card-border);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.setup-guide-content a {
    color: var(--accent);
    text-decoration: underline;
}

.guide-steps {
    margin: 0;
    padding-right: 20px;
}

.guide-steps li {
    margin-bottom: 12px;
}

.guide-steps li strong {
    color: var(--text-primary);
}

.perms-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.perms-pills code {
    background: rgba(88, 166, 255, 0.15);
    color: #79c0ff;
    border: 1px solid rgba(88, 166, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
}

/* شريط الترحيب والبدء */
.onboarding-banner {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(35, 134, 54, 0.12));
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.4s ease;
}

@media (max-width: 768px) {
    .onboarding-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.onboarding-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.onboarding-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.onboarding-text h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.onboarding-text p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-onboarding-action {
    background: linear-gradient(90deg, #1f6feb, #238636);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.4);
    transition: var(--transition);
}

.btn-onboarding-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 134, 54, 0.5);
}

/* ========================================================
   شريط التبويبات الرئيسي (Main Navigation Tabs)
   ======================================================== */
.main-nav-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nav-tab-btn {
    background: rgba(22, 27, 34, 0.75);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 13px 24px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    user-select: none;
}

.nav-tab-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(88, 166, 255, 0.4);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-tab-btn.active {
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.25), rgba(88, 166, 255, 0.12));
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(31, 111, 235, 0.35);
}

.nav-tab-btn .tab-icon {
    font-size: 18px;
}

.nav-tab-btn .tab-badge {
    background: var(--accent);
    color: #0d1117;
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 4px;
}

/* ========================================================
   شريط التنبيه بحجز موعد من الجدول (Selected Slot Banner)
   ======================================================== */
.selected-slot-banner {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(35, 134, 54, 0.15));
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    animation: pulseGlow 1.5s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(88, 166, 255, 0.2); }
    to { box-shadow: 0 0 20px rgba(88, 166, 255, 0.5); }
}

.slot-banner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slot-banner-icon {
    font-size: 24px;
}

.slot-banner-date {
    display: inline-block;
    color: var(--accent);
    font-weight: 800;
    margin-right: 6px;
    background: rgba(88, 166, 255, 0.12);
    padding: 2px 8px;
    border-radius: 6px;
}

.btn-clear-slot {
    background: rgba(218, 54, 51, 0.15);
    border: 1px solid rgba(218, 54, 51, 0.4);
    color: #ff7b72;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-slot:hover {
    background: var(--danger);
    color: #fff;
}

/* زر التحويل إلى مخطط ميتا في القائمة الجانبية */
.scheduled-planner-cta {
    margin-bottom: 16px;
}

.btn-open-planner-cta {
    width: 100%;
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.15), rgba(88, 166, 255, 0.08));
    border: 1px dashed rgba(88, 166, 255, 0.4);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: inherit;
    text-align: right;
    transition: var(--transition);
}

.btn-open-planner-cta:hover {
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.3), rgba(88, 166, 255, 0.2));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.25);
}

.btn-open-planner-cta .cta-icon {
    font-size: 24px;
}

.btn-open-planner-cta .cta-text {
    flex: 1;
}

.btn-open-planner-cta .cta-text strong {
    display: block;
    font-size: 14px;
    color: var(--accent);
}

.btn-open-planner-cta .cta-text small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-open-planner-cta .cta-arrow {
    font-size: 16px;
    color: var(--accent);
    transition: transform 0.2s ease;
}

.btn-open-planner-cta:hover .cta-arrow {
    transform: translateX(-4px);
}

/* ========================================================
   قسم مخطط المحتوى والجدولة مثل ميتا (Meta Planner Card)
   ======================================================== */
.planner-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
}

.planner-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.planner-icon-badge {
    font-size: 30px;
    background: rgba(88, 166, 255, 0.12);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.planner-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.planner-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-quick-schedule {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(31, 111, 235, 0.35);
    transition: var(--transition);
}

.btn-quick-schedule:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 111, 235, 0.5);
}

/* شريط التنقل الزمني والفلترة */
.planner-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 0;
}

.planner-week-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-nav-week, .btn-nav-today {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-nav-week:hover, .btn-nav-today:hover {
    background: rgba(88, 166, 255, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-nav-today {
    background: rgba(31, 111, 235, 0.2);
    border-color: rgba(88, 166, 255, 0.4);
    color: var(--accent);
}

.planner-date-display {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid var(--card-border);
    padding: 7px 16px;
    border-radius: 20px;
}

.planner-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 6px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.filter-btn.active {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent);
    color: var(--text-primary);
}

.planner-interactive-hint {
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #a5d6ff;
}

/* ========================================================
   جدول الأيام والساعات (Schedule Grid)
   ======================================================== */
.planner-grid-wrapper {
    overflow-x: auto;
    max-height: 700px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: #0d1117;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* تخصيص شريط التمرير */
.planner-grid-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.planner-grid-wrapper::-webkit-scrollbar-track {
    background: #0d1117;
}
.planner-grid-wrapper::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.planner-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(160px, 1fr));
    min-width: 1200px;
}

/* صف الرأس (الأيام) */
.grid-header-cell {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #161b22;
    padding: 14px 10px;
    text-align: center;
    border-bottom: 2px solid var(--card-border);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.grid-header-cell.time-header {
    border-left: 1px solid var(--card-border);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-header-cell .day-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.grid-header-cell .day-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.grid-header-cell.is-today {
    background: linear-gradient(180deg, rgba(31, 111, 235, 0.25) 0%, #161b22 100%);
    border-bottom: 3px solid var(--accent);
}

.grid-header-cell.is-today .day-name {
    color: var(--accent);
}

.grid-header-cell .today-badge {
    display: inline-block;
    background: var(--accent);
    color: #0d1117;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    margin-top: 4px;
}

/* خلية التوقيت (عمود الساعات) */
.grid-time-cell {
    padding: 12px 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 1px solid var(--card-border);
    background: #13171f;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    right: 0;
    z-index: 5;
}

/* خانة اليوم والساعة (Cell) */
.grid-slot-cell {
    min-height: 85px;
    padding: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    transition: var(--transition);
    background: #0d1117;
}

.grid-slot-cell.is-today-col {
    background: rgba(88, 166, 255, 0.02);
}

/* خانة متاحة للجدولة */
.grid-slot-cell.empty-slot {
    cursor: pointer;
}

.grid-slot-cell.empty-slot:hover {
    background: rgba(88, 166, 255, 0.08) !important;
    border: 1px dashed rgba(88, 166, 255, 0.5);
    box-shadow: inset 0 0 15px rgba(31, 111, 235, 0.2);
}

.slot-hover-action {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    animation: fadeIn 0.2s ease;
}

.grid-slot-cell.empty-slot:hover .slot-hover-action {
    display: flex;
}

.slot-hover-icon {
    font-size: 20px;
    background: rgba(88, 166, 255, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* خانة تحتوي على منشورات مجدولة */
.grid-slot-cell.has-posts {
    background: rgba(22, 27, 34, 0.6);
}

/* كارت المنشور المصغر داخل الخانة مثل ميتا (Post Chip) */
.planner-post-chip {
    background: linear-gradient(135deg, #1c2128, #161b22);
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-right: 3px solid var(--accent);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    cursor: pointer;
}

.planner-post-chip:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(31, 111, 235, 0.35);
}

.planner-post-chip.status-published {
    border-right-color: var(--success);
    border-color: rgba(35, 134, 54, 0.4);
}

.chip-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 4px;
}

.chip-platforms {
    display: flex;
    gap: 3px;
    font-size: 12px;
}

.chip-time-badge {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
}

.planner-post-chip.status-published .chip-time-badge {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
}

.chip-content {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chip-thumbnail {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
}

.chip-text {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.chip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-chip-action {
    background: transparent;
    border: none;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    padding: 2px 4px;
    border-radius: 4px;
}

.btn-chip-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.btn-chip-action.delete:hover {
    background: rgba(218, 54, 51, 0.2);
    color: var(--danger);
}

/* دليل الألوان */
.planner-legend {
    display: flex;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.legend-box.available-box {
    background: #0d1117;
    border: 1px dashed rgba(88, 166, 255, 0.6);
}

.legend-box.scheduled-box {
    background: #1c2128;
    border: 1px solid var(--accent);
    border-right: 3px solid var(--accent);
}

.legend-box.today-box {
    background: rgba(31, 111, 235, 0.25);
    border: 1px solid var(--accent);
}

/* ========================================================
   نافذة معاينة المنشور المجدول (Post Preview Modal)
   ======================================================== */
.modal-preview-dialog {
    max-width: 650px;
}

.preview-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
}

.btn-delete-scheduled-danger {
    background: rgba(218, 54, 51, 0.15);
    border: 1px solid var(--danger);
    color: #ff7b72;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete-scheduled-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(218, 54, 51, 0.4);
}

.preview-post-card {
    background: #0d1117;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.preview-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 10px;
}

.preview-media-frame {
    max-height: 360px;
    border-radius: 8px;
    overflow: hidden;
    margin: 14px 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-media-frame img, .preview-media-frame video {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.preview-first-comment-box {
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 14px;
}

.preview-first-comment-box strong {
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* ==========================================================================
   🤖 قسم الرد التلقائي الذكي (AI Auto-Reply Bot)
   ========================================================================== */

.autoreply-card {
    border-top: 3px solid #10b981;
}

.autoreply-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.autoreply-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 700;
}

/* التبديل الرئيسي للتشغيل/الإيقاف (Master Switch) */
.autoreply-master-toggle {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 34px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

/* شبكة الأعمدة للرد التلقائي */
.autoreply-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .autoreply-grid {
        grid-template-columns: 1fr;
    }
}

.autoreply-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* كروت الأقسام الداخلية (Sub Cards) */
.sub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
}

.sub-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.sub-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sub-card-title.space-between {
    justify-content: space-between;
}

.sub-icon {
    font-size: 24px;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-card-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sub-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* استكشاف وسحب الموقع */
.scrape-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-scrape-action {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-scrape-action:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.scrape-status-box {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.scrape-status-box.loading {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.scrape-status-box.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.scrape-status-box.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* خيارات وقواعد التفاعل */
.interaction-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.interaction-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: var(--transition);
}

.interaction-check:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.interaction-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.interaction-check .check-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: var(--transition);
}

.interaction-check input[type="checkbox"]:checked ~ .check-box {
    background: #10b981;
    border-color: #10b981;
}

.interaction-check input[type="checkbox"]:checked ~ .check-box:after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 13px;
    font-weight: 800;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
}

.interaction-check strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.interaction-check small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* استوديو التجربة والمحاكاة (Live Simulator) */
.simulator-card {
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04), rgba(255, 255, 255, 0.02));
}

.btn-test-sim {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-test-sim:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sim-results-box {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.3s ease;
}

.sim-result-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.badge-mini {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.badge-mini.dm-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.comment-bubble {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px 12px 12px 3px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #e0f2fe;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

.dm-bubble {
    background: linear-gradient(145deg, rgba(147, 51, 234, 0.12), rgba(79, 70, 229, 0.08));
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 12px 12px 3px 12px;
    padding: 16px 18px;
    font-size: 13.5px;
    line-height: 1.75;
    color: #f3e8ff;
    white-space: pre-wrap;
    word-break: break-word;
}

/* سجل النشاط (Activity Log) */
.btn-refresh-log {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-refresh-log:hover {
    background: rgba(255, 255, 255, 0.12);
}

.activity-logs-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.empty-logs {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.log-entry-card {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.log-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-platform-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.log-platform-tag.facebook {
    background: rgba(24, 119, 242, 0.2);
    color: #60a5fa;
}

.log-platform-tag.instagram {
    background: rgba(225, 48, 108, 0.2);
    color: #f472b6;
}

.log-time {
    color: var(--text-secondary);
    font-size: 10px;
}

.log-comment-text {
    color: var(--text-primary);
    font-weight: 600;
}

.log-actions-taken {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #34d399;
    margin-top: 2px;
}

/* ========================================================
   🏢 شريط ربط المشروع بالصفحة (Project Page Binding Bar)
   ======================================================== */
.project-page-binding-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.08), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.binding-label-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.binding-icon {
    font-size: 20px;
}

.binding-select {
    min-width: 280px;
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(88, 166, 255, 0.4);
    color: #f0f6fc;
    font-weight: 600;
}

/* ========================================================
   🌐 فحص الـ 4 صفحات والعداد التنازلي (Deep Crawler UI)
   ======================================================== */
.deep-crawl-tracker {
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px;
    animation: fadeIn 0.3s ease;
}

.crawler-steps-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .crawler-steps-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.crawler-step-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.crawler-step-pill.active {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.5);
    color: #58a6ff;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
}

.crawler-step-pill.waiting {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.5);
    color: #facc15;
    font-weight: 700;
}

.crawler-step-pill.done {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-weight: 700;
}

.step-num {
    background: rgba(255, 255, 255, 0.1);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

.crawler-progress-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.crawler-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.crawler-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.crawler-countdown-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    animation: pulseSlow 2s infinite;
}

.countdown-pulse-icon {
    font-size: 22px;
    animation: spinSlow 4s linear infinite;
}

.countdown-content strong {
    display: block;
    font-size: 12px;
    color: #fef08a;
}

.countdown-content p {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

.seconds-highlight {
    color: #facc15;
    font-weight: 800;
    font-size: 13px;
}

/* ========================================================
   🛠️ مربعات تكرار الخدمات وبيانات التواصل (Dynamic Repeaters)
   ======================================================== */
.form-section-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 14px;
}

.section-box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.box-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.box-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.repeaters-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.repeaters-container.mini-gap {
    gap: 6px;
}

.btn-add-repeater {
    background: rgba(88, 166, 255, 0.12);
    border: 1px dashed rgba(88, 166, 255, 0.4);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-add-repeater:hover {
    background: rgba(88, 166, 255, 0.22);
    border-style: solid;
}

.btn-add-repeater-mini {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-repeater-mini:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* كارت الخدمة الفردي (3 حقول + زر حذف) */
.service-repeater-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
    position: relative;
}

.service-repeater-card:hover {
    border-color: rgba(88, 166, 255, 0.25);
}

.repeater-row-top {
    display: grid;
    grid-template-columns: 1fr 140px 36px;
    gap: 8px;
    align-items: center;
}

@media (max-width: 600px) {
    .repeater-row-top {
        grid-template-columns: 1fr 1fr 36px;
    }
}

.btn-del-repeater {
    width: 34px;
    height: 34px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

.btn-del-repeater:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* سطر أرقام الهواتف وروابط السوشيال */
.sub-repeater-group {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 8px 10px;
}

.sub-repeater-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.phone-repeater-row,
.social-repeater-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.social-select {
    width: 140px;
    flex-shrink: 0;
}

/* ========================================================
   🎯 نطاق تحديد المنشورات (Target Posts Scope)
   ======================================================== */
.target-scope-radios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .target-scope-radios {
        grid-template-columns: 1fr;
    }
}

.scope-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.scope-radio-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.scope-radio-card input[type="radio"] {
    margin-top: 3px;
    accent-color: #10b981;
}

.scope-radio-card:has(input[type="radio"]:checked) {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.radio-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.target-posts-wrapper {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
    animation: fadeIn 0.3s ease;
}

.posts-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.btn-refresh-posts {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-refresh-posts:hover {
    background: rgba(255, 255, 255, 0.12);
}

.posts-checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.post-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.post-checklist-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.post-checklist-item.selected {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.4);
}

.post-thumb {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    background: #111;
    flex-shrink: 0;
}

.post-info-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.post-caption-snippet {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date-tag {
    font-size: 9px;
    color: var(--text-secondary);
}

/* ========================================================
   ✨ مولد البرومبت المخصص (AI Prompt Builder)
   ======================================================== */
.prompt-builder-card {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(147, 51, 234, 0.25);
}

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

.prompt-icon-sparkle {
    font-size: 24px;
}

.btn-generate-custom-prompt {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
    transition: var(--transition);
}

.btn-generate-custom-prompt:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

.custom-prompt-textarea {
    font-family: inherit;
    font-size: 12px !important;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3) !important;
    color: #f3e8ff !important;
    border-color: rgba(147, 51, 234, 0.25) !important;
}

.btn-save-knowledge {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

.form-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

