/* ===================================================================== */
/* Start.AI Community Pages Stylesheet v01.00.07                         */
/* UI/UX Polish + Server Media Controls + Real Page Theme Renderer       */
/* ===================================================================== */

/* Override parent DNN Aperture pane width bottleneck when hosting Start.AI Community Pages */
.aperture-content-pane:has(#sai-community-root),
.aperture-content-pane.sai-wide-pane {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sai-community-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px 24px 20px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    max-width: 1440px;
    width: calc(100% - 32px);
    margin: 12px auto;
    box-sizing: border-box;
}

.sai-community-container *,
.sai-community-container *::before,
.sai-community-container *::after {
    box-sizing: border-box;
}

/* Real Portal Page Theme Container */
.sai-live-theme-container {
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.sai-real-portal-page {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.sai-real-page-cover {
    height: 280px !important;
}

.sai-live-theme-pill {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header - Tối ưu siêu gọn gàng (Single Compact Toolbar) */
.sai-comm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.sai-comm-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sai-comm-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sai-comm-icon-globe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #eff6ff;
    color: #2563eb;
    flex-shrink: 0;
}

.sai-comm-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.sai-comm-badge {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 1.5px 8px;
    border-radius: 9999px;
    line-height: 1.2;
}

.sai-comm-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
}

.sai-comm-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sub-toolbar (Thanh lọc và tìm kiếm gọn gàng) */
.sai-comm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
}

/* Nav Tabs */
.sai-comm-nav {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.sai-comm-nav-btn {
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.sai-comm-nav-btn:hover {
    color: #0f172a;
    background: #ffffff;
}

.sai-comm-nav-btn.active {
    background: #ffffff;
    color: #2563eb;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sai-count-chip {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    line-height: 1.2;
}

.sai-comm-nav-btn.active .sai-count-chip {
    background: #eff6ff;
    color: #2563eb;
}

/* Search Box */
.sai-comm-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.sai-comm-search-box .sai-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.sai-comm-search-box input {
    width: 280px;
    max-width: 100%;
    height: 32px;
    padding: 0 12px 0 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12.5px;
    background-color: #ffffff;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.sai-comm-search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.15);
}

/* Nút quay lại danh sách ở trang tạo trang mới */
.sai-comm-back-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.sai-comm-back-top-btn:hover {
    background: #ffffff;
    color: #2563eb;
    border-color: #94a3b8;
}

/* Panes */
.sai-comm-pane {
    display: none;
}

.sai-comm-pane.active {
    display: block;
}

/* Buttons */
.sai-comm-btn {
    border: none;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.sai-comm-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.sai-comm-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
}

.sai-comm-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.sai-comm-btn-neutral {
    background-color: #e2e8f0;
    color: #334155 !important;
}

.sai-comm-btn-neutral:hover:not(:disabled) {
    background-color: #cbd5e1;
}

.sai-comm-btn-outline {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155 !important;
}

.sai-comm-btn-outline:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.sai-comm-btn-danger-outline {
    background-color: #ffffff;
    border: 1px solid #fecaca;
    color: #dc2626 !important;
}

.sai-comm-btn-danger-outline:hover:not(:disabled) {
    background-color: #fef2f2;
    border-color: #f87171;
}

.sai-comm-btn-sm {
    padding: 6px 12px;
    font-size: 0.825rem;
}

.sai-comm-btn-xs {
    padding: 5px 10px;
    font-size: 0.775rem;
    gap: 4px;
}

/* Form Styles */
.sai-form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.sai-form-header {
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
}

.sai-pages-form-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.sai-pages-form-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.sai-form-group {
    margin-bottom: 18px;
}

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

.sai-label-row .sai-label {
    margin-bottom: 0;
}

.sai-char-counter {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.sai-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sai-label.required::after {
    content: " *";
    color: #ef4444;
}

.sai-input, .sai-textarea, .sai-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1e293b;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sai-input:focus, .sai-textarea:focus, .sai-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sai-textarea {
    resize: vertical;
    min-height: 70px;
}

.sai-help-text {
    display: block;
    font-size: 0.775rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.35;
}

/* Subdomain input with prefix/suffix */
.sai-subdomain-input-wrap {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.sai-subdomain-input-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sai-input-prefix, .sai-input-suffix {
    padding: 9px 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
    white-space: nowrap;
}

.sai-input-suffix-readonly {
    border: none !important;
    border-left: 1px solid #e2e8f0 !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: default;
    width: auto;
    min-width: 90px;
    max-width: 200px;
    text-align: left;
    font-family: inherit;
}

.sai-subdomain-field {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 9px 8px !important;
    flex: 1;
    min-width: 0;
}

.sai-subdomain-feedback {
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 500;
}

.sai-feedback-valid {
    color: #16a34a;
}

.sai-feedback-invalid {
    color: #dc2626;
}

/* ================================================================= */
/* URL Mode Selector & Preview Box (v01.00.08)                       */
/* ================================================================= */
.sai-url-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.sai-url-mode-btn {
    display: flex;
    align-items: flex-start;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.sai-url-mode-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.sai-url-mode-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}

.sai-mode-radio-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    margin-top: 2px;
    margin-right: 10px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sai-url-mode-btn.active .sai-mode-radio-dot {
    border-color: #2563eb;
    background-color: #2563eb;
    box-shadow: inset 0 0 0 2.5px #ffffff;
}

.sai-mode-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
    letter-spacing: 0.2px;
    display: block;
}

.sai-url-mode-btn.active .sai-mode-title {
    color: #1d4ed8;
}

.sai-mode-desc {
    display: block;
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.35;
}

.sai-url-mode-btn.active .sai-mode-desc {
    color: #2563eb;
}

.sai-final-url-box {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.sai-final-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sai-final-url-row:last-child {
    margin-bottom: 0;
}

.sai-final-url-tag {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    min-width: 70px;
    text-align: center;
}

.sai-final-url-row code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    color: #0f172a;
    word-break: break-all;
}

.sai-final-url-box {
    margin-top: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sai-final-url-label {
    color: #64748b;
    font-weight: 600;
}

.sai-final-url-box code {
    color: #1d4ed8;
    font-weight: 600;
    word-break: break-all;
}

/* Image input wrap with upload button & media control card */
.sai-image-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sai-image-url-field {
    flex: 1;
    min-width: 0;
}

.sai-upload-label {
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    padding: 8px 12px;
}

.sai-file-hidden {
    display: none !important;
}

.sai-upload-feedback {
    font-size: 0.78rem;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.sai-upload-feedback.loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.sai-upload-feedback.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.sai-upload-feedback.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Media Thumbnail + Replace / Remove / Crop Card */
.sai-media-control-card {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.sai-media-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sai-media-thumb-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #e2e8f0;
    background-size: cover;
    background-position: 50% 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sai-media-thumb-cover {
    width: 110px;
    height: 48px;
    border-radius: 6px;
    background-color: #e2e8f0;
    background-size: cover;
    background-position: 50% 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sai-media-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sai-media-align-controls {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.sai-align-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.sai-align-sliders {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sai-align-sliders label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}

.sai-align-sliders input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Theme badge notice */
.sai-theme-badge-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 18px 0;
}

.sai-theme-badge-icon {
    font-size: 1.25rem;
    color: #2563eb;
    line-height: 1;
}

.sai-theme-badge-info strong {
    display: block;
    font-size: 0.85rem;
    color: #1e40af;
    margin-bottom: 2px;
}

.sai-theme-badge-info p {
    font-size: 0.775rem;
    color: #475569;
    margin: 0;
    line-height: 1.35;
}

/* Actions */
.sai-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* Spinner */
.sai-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: sai-spin 0.8s linear infinite;
}

@keyframes sai-spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.sai-comm-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.875rem;
}

.sai-comm-alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

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

.sai-comm-alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ================================================================= */
/* FACEBOOK PAGES CREATION 2-COLUMN LAYOUT (PHẦN 1)                  */
/* ================================================================= */
.sai-pages-creation-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.sai-pages-form-col {
    flex: 0 0 365px;
    width: 365px;
    min-width: 350px;
    max-width: 380px;
}

.sai-pages-preview-col {
    flex: 1 1 auto;
    min-width: 650px;
    position: sticky;
    top: 116px;
    z-index: 10;
    align-self: flex-start;
}

/* Preview Panel */
.sai-preview-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    max-width: 100%;
}

.sai-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
}

.sai-preview-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.sai-preview-tip {
    font-size: 0.775rem;
    color: #64748b;
    margin-left: 8px;
}

.sai-preview-device-toggle {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 6px;
}

.sai-device-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sai-device-btn:hover {
    color: #0f172a;
}

.sai-device-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Viewport Frame */
.sai-preview-viewport-wrap {
    padding: 20px;
    background: #f1f5f9;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

.sai-preview-screen {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 100%;
}

/* Desktop Mode */
.sai-preview-screen.mode-desktop {
    max-width: 100%;
}

.sai-preview-screen.mode-desktop .sai-mock-mobile-notch {
    display: none;
}

/* Mobile Mode */
.sai-preview-screen.mode-mobile {
    width: 100%;
    max-width: 375px;
    border: 8px solid #1e293b;
    border-radius: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

.sai-preview-screen.mode-mobile .sai-mock-browser-bar {
    display: none;
}

.sai-preview-screen.mode-mobile .sai-mock-mobile-notch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px 4px 18px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
}

.sai-mobile-sensors {
    width: 60px;
    height: 12px;
    background: #000000;
    border-radius: 6px;
}

/* Mock Browser Top Bar */
.sai-mock-browser-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sai-mock-dots {
    display: flex;
    gap: 6px;
}

.sai-mock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.sai-mock-dot.red { background: #ef4444; }
.sai-mock-dot.yellow { background: #f59e0b; }
.sai-mock-dot.green { background: #10b981; }

.sai-mock-url {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.775rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sai-mock-lock {
    font-size: 0.75rem;
    color: #10b981;
}

/* ================================================================= */
/* START.AI DEFAULT PAGE UI (INSIDE CANVAS & REAL PORTAL THEME)       */
/* ================================================================= */
.sai-page-canvas {
    background: #f0f2f5;
    min-height: 520px;
}

/* Cover Banner */
.sai-page-cover {
    height: 210px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    position: relative;
    background-size: cover;
    background-position: 50% 50%;
    transition: background-image 0.2s ease, background-position 0.1s ease;
}

.sai-preview-screen.mode-mobile .sai-page-cover {
    height: 125px;
}

.sai-page-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.38) 0%, transparent 60%);
}

/* Profile Header Strip */
.sai-page-header-strip {
    background: #ffffff;
    padding: 0 24px 16px 24px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
}

.sai-preview-screen.mode-mobile .sai-page-header-strip {
    padding: 0 16px 14px 16px;
    flex-direction: column;
    align-items: flex-start;
}

.sai-page-header-main {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    max-width: 100%;
}

.sai-preview-screen.mode-mobile .sai-page-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* Avatar */
.sai-page-avatar-wrap {
    margin-top: -48px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.sai-page-avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border: 4px solid #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.3rem;
    font-weight: 700;
    overflow: hidden;
    background-size: cover;
    background-position: 50% 50%;
}

.sai-preview-screen.mode-mobile .sai-page-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
    margin-top: -36px;
}

/* Identity */
.sai-page-identity {
    padding-bottom: 6px;
    min-width: 0;
}

.sai-page-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sai-page-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #050505;
    margin: 0 0 4px 0;
    line-height: 1.25;
    word-break: break-word;
}

.sai-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1877f2;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.sai-preview-screen.mode-mobile .sai-page-title {
    font-size: 1.15rem;
}

.sai-page-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sai-page-cat-badge {
    background: #e7f3ff;
    color: #1877f2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sai-meta-dot {
    color: #65676b;
    font-weight: bold;
}

.sai-page-domain-tag {
    font-size: 0.75rem;
    color: #65676b;
    word-break: break-all;
}

/* Action Buttons */
.sai-page-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.sai-preview-screen.mode-mobile .sai-page-actions {
    width: 100%;
    margin-top: 8px;
}

.sai-page-btn {
    border: none;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.sai-page-btn-primary {
    background: #1877f2;
    color: #ffffff;
}

.sai-page-btn-primary.following {
    background: #e4e6eb;
    color: #050505;
}

.sai-page-btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.sai-page-btn-icon {
    background: #e4e6eb;
    color: #050505;
    padding: 7px 10px;
}

.sai-preview-screen.mode-mobile .sai-page-btn-primary,
.sai-preview-screen.mode-mobile .sai-page-btn-secondary {
    flex: 1;
    justify-content: center;
}

/* Nav Tabs */
.sai-page-nav-tabs {
    background: #ffffff;
    display: flex;
    padding: 0 24px;
    border-bottom: 1px solid #e4e6eb;
    overflow-x: auto;
    scrollbar-width: none;
}

.sai-page-nav-tabs::-webkit-scrollbar {
    display: none;
}

.sai-page-nav-item {
    padding: 12px 14px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.sai-page-nav-item.active {
    color: #1877f2;
    border-bottom-color: #1877f2;
}

/* Page Body Grid */
.sai-page-body-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    padding: 16px 24px;
}

.sai-preview-screen.mode-mobile .sai-page-body-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
}

/* Left Card: About */
.sai-page-about-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.sai-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 10px 0;
}

.sai-about-bio {
    font-size: 0.825rem;
    color: #050505;
    line-height: 1.4;
    margin: 0 0 12px 0;
    word-break: break-word;
}

.sai-about-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #f0f2f5;
    padding-top: 10px;
}

.sai-about-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.775rem;
    color: #65676b;
    word-break: break-word;
}

.sai-about-icon {
    font-size: 0.9rem;
}

/* Right Col: Feed */
.sai-page-feed-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.sai-post-composer {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sai-composer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    background-size: cover;
    background-position: 50% 50%;
}

.sai-composer-input {
    background: #f0f2f5;
    border-radius: 20px;
    padding: 8px 14px;
    color: #65676b;
    font-size: 0.825rem;
    flex: 1;
}

.sai-post-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sai-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.sai-post-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    background-size: cover;
    background-position: 50% 50%;
}

.sai-post-author-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #050505;
    margin: 0;
}

.sai-post-time {
    font-size: 0.725rem;
    color: #65676b;
}

.sai-post-content {
    padding: 0 14px 12px 14px;
    font-size: 0.85rem;
    color: #050505;
    line-height: 1.45;
}

.sai-post-content p {
    margin: 0;
}

.sai-post-footer {
    display: flex;
    border-top: 1px solid #f0f2f5;
    padding: 4px 6px;
}

.sai-post-btn {
    flex: 1;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #65676b;
    border-radius: 4px;
    cursor: pointer;
}

.sai-post-btn:hover {
    background: #f0f2f5;
}

.sai-post-btn.liked {
    color: #1877f2;
}

/* ================================================================= */
/* MY PAGES CARDS (PANE 1)                                           */
/* ================================================================= */
.sai-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.sai-page-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sai-page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.sai-page-card-cover {
    height: 100px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    position: relative;
    padding: 10px;
    background-size: cover;
    background-position: 50% 50%;
}

.sai-page-card-status {
    position: absolute;
    top: 10px;
    right: 10px;
}

.sai-page-card-body {
    padding: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sai-page-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: -28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.3rem;
    background-size: cover;
    background-position: 50% 50%;
}

.sai-page-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.sai-page-card-category {
    font-size: 0.8rem;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 6px;
}

.sai-page-card-urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 12px 0;
}

.sai-card-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    overflow: hidden;
}

.sai-url-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sai-tag-primary {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.sai-tag-sec {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sai-page-card-link {
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sai-page-card-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.sai-page-card-stats {
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.sai-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sai-stat-box strong {
    font-size: 0.95rem;
    color: #0f172a;
}

.sai-stat-box span {
    font-size: 0.7rem;
    color: #64748b;
}

.sai-page-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.sai-page-card-actions .sai-comm-btn {
    flex: 1;
}

/* Badges */
.sai-site-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sai-badge-active {
    background-color: #dcfce7;
    color: #166534;
}

.sai-badge-provisioning {
    background-color: #fef3c7;
    color: #92400e;
}

.sai-badge-suspended {
    background-color: #fee2e2;
    color: #991b1b;
}

.sai-badge-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Empty State */
.sai-sites-empty-state {
    text-align: center;
    padding: 48px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.sai-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.sai-sites-empty-state h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.sai-sites-empty-state p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 20px 0;
}

/* Detail Card */
.sai-detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.sai-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.sai-detail-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #0f172a;
}

.sai-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.sai-detail-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 12px 14px;
}

.sai-detail-item label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.sai-detail-item span {
    font-size: 0.925rem;
    color: #0f172a;
    font-weight: 600;
}

/* Loading */
.sai-comm-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 0.9rem;
}

.sai-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sai-spin 0.8s linear infinite;
    margin: 0 auto 12px auto;
}

/* ================================================================= */
/* RESPONSIVE DESIGN (TABLET & MOBILE)                               */
/* ================================================================= */
@media (max-width: 1099px) {
    .sai-pages-creation-layout {
        flex-direction: column;
    }
    .sai-pages-form-col {
        order: 1;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    .sai-pages-preview-col {
        order: 2;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .sai-page-body-grid {
        grid-template-columns: 1fr;
        padding: 14px;
    }
    .sai-sites-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sai-community-container {
        padding: 10px 12px 20px 12px;
        width: 100%;
        margin: 8px 0;
        border-radius: 8px;
    }
    .sai-comm-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
    .sai-comm-header-right button {
        width: 100%;
    }
    .sai-comm-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px;
    }
    .sai-comm-search-box input {
        width: 100%;
    }
    .sai-preview-viewport-wrap {
        padding: 10px;
    }
    .sai-preview-screen.mode-mobile {
        width: 100%;
        max-width: 100%;
        border-width: 6px;
        border-radius: 24px;
    }
    .sai-real-page-cover {
        height: 180px !important;
    }
}


/* ========================================================================= */
/* SITES LIST: CHUẨN GIAO DIỆN FACEBOOK PAGES CARD (HÌNH 1)                  */
/* Tinh gọn, khoa học, loại bỏ hoàn toàn banner thừa và bảng kỹ thuật rườm rà */
/* ========================================================================= */
.sai-sites-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 960px;
}

.sai-fb-page-card {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.sai-fb-page-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.sai-fb-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    width: 100%;
}

.sai-fb-page-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1877f2 0%, #4f46e5 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.3rem;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.sai-fb-page-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sai-fb-page-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sai-fb-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #050505;
    margin: 0;
    line-height: 1.3;
}

.sai-fb-page-title a {
    color: #050505 !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.sai-fb-page-title a:hover {
    color: #1877f2 !important;
    text-decoration: underline !important;
}

.sai-fb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    line-height: 1.2;
}

.sai-fb-status-badge.is-active {
    background: #e8f5e9;
    color: #1b5e20;
}

.sai-fb-status-badge.is-active .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
}

.sai-fb-status-badge.is-pending {
    background: #fff8e1;
    color: #b78103;
}

.sai-fb-status-badge.is-pending .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.sai-fb-page-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #65676b;
}

.sai-fb-meta-dot {
    color: #94a3b8;
    font-size: 10px;
}

.sai-fb-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #65676b;
}

.sai-fb-meta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1877f2 !important;
    font-weight: 500;
    text-decoration: none !important;
}

.sai-fb-meta-link:hover {
    text-decoration: underline !important;
}

.sai-fb-page-corner {
    flex-shrink: 0;
    align-self: flex-start;
}

.sai-fb-portal-tag {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.sai-fb-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.sai-fb-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.15s ease;
    line-height: normal;
    box-sizing: border-box;
}

.sai-fb-btn-visit {
    background: #ebf5ff !important;
    color: #1877f2 !important;
}

.sai-fb-btn-visit:hover {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.sai-fb-btn-manage {
    background: #e4e6eb !important;
    color: #050505 !important;
}

.sai-fb-btn-manage:hover {
    background: #d8dadf !important;
}

.sai-fb-btn-more {
    background: #e4e6eb !important;
    color: #050505 !important;
}

.sai-fb-btn-more:hover {
    background: #d8dadf !important;
}

@media (max-width: 640px) {
    .sai-fb-page-header {
        align-items: flex-start;
    }
    .sai-fb-page-actions {
        flex-direction: column;
        width: 100%;
    }
    .sai-fb-action-btn {
        width: 100%;
    }
}


/* ========================================================================= */
/* DUAL URLS DISPLAY (SUBDOMAIN + THƯ MỤC) GỌN GÀNG KHOA HỌC TRONG THẺ       */
/* ========================================================================= */
.sai-fb-page-urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 7px 10px;
    width: 100%;
}

.sai-fb-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    min-width: 0;
}

.sai-fb-url-tag {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: normal;
}

.sai-fb-url-tag.tag-subdomain {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.sai-fb-url-tag.tag-path {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sai-fb-url-link {
    color: #1877f2 !important;
    font-size: 12.5px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-decoration: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    transition: color 0.15s ease;
}

.sai-fb-url-link:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

.sai-ext-arrow {
    display: inline-block;
    font-size: 11px;
    color: #60a5fa;
    margin-left: 2px;
}

.sai-fb-url-copy-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sai-fb-url-copy-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}


/* ========================================================================= */
/* ẨN PHẦN CHỌN CHẾ ĐỘ ĐỊNH DANH URL (MẶC ĐỊNH LUÔN CHỌN CẢ HAI - DUAL MODE) */
/* ========================================================================= */
#sai-form-group-urlmode,
.sai-url-mode-selector,
.sai-form-group:has(.sai-url-mode-selector),
.sai-form-group:has(#sai-input-urlmode),
.sai-form-group:has(#sai-mode-btn-dual) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}


/* Đổi nhãn Link 1, Link 2 chuẩn hiển thị */
.sai-fb-url-tag {
    text-transform: none !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    border-radius: 5px !important;
}


/* ========================================================================= */
/* DYNAMIC INTERACTIVE PAGE SECTIONS (Trang chủ, Giới thiệu, Bài viết...)   */
/* ========================================================================= */
.sai-page-section-pane {
    display: none;
    animation: saiSecFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sai-page-section-pane.active {
    display: block;
}

@keyframes saiSecFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Full Width Card Containers for Sub-sections */
.sai-sec-full-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin: 16px 24px;
    padding: 24px;
    border: 1px solid #e4e6eb;
}

.sai-sec-card-header {
    border-bottom: 1px solid #e4e6eb;
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.sai-sec-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 4px 0;
}

.sai-sec-sub {
    font-size: 0.875rem;
    color: #65676b;
    margin: 0;
}

.sai-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.sai-btn-add-product {
    background: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sai-btn-add-product:hover {
    background: #166fe5;
}

/* Section: About Grid */
.sai-sec-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .sai-sec-about-grid {
        grid-template-columns: 1fr;
    }
    .sai-sec-full-card {
        margin: 12px 14px;
        padding: 16px;
    }
}

.sai-sec-about-box {
    background: #f0f2f5;
    border-radius: 8px;
    padding: 18px 20px;
}

.sai-box-title {
    font-size: 1rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 12px 0;
}

.sai-box-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4b4f56;
    margin: 0;
}

.sai-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sai-info-list li {
    font-size: 0.875rem;
    color: #4b4f56;
    display: flex;
    gap: 8px;
}

.sai-info-list li strong {
    color: #050505;
    min-width: 140px;
}

.sai-status-active {
    color: #31a24c;
    font-weight: 600;
}

/* Section: Posts Filter */
.sai-sec-posts-container {
    max-width: 720px;
    margin: 16px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sai-posts-filter-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.sai-filter-pill {
    background: #e4e6eb;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #050505;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sai-filter-pill.active,
.sai-filter-pill:hover {
    background: #1877f2;
    color: #ffffff;
}

/* Section: Products Grid */
.sai-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sai-product-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e4e6eb;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sai-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.sai-prod-thumb {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sai-prod-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.sai-prod-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.65);
    color: #ffffff;
    padding: 3px 10px;
    font-size: 0.725rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.sai-prod-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sai-prod-title {
    font-size: 1rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.sai-prod-desc {
    font-size: 0.825rem;
    color: #65676b;
    line-height: 1.5;
    margin: 0 0 14px 0;
    flex: 1;
}

.sai-prod-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e4e6eb;
}

.sai-prod-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e41e3f;
}

.sai-prod-rating {
    font-size: 0.775rem;
    color: #65676b;
    font-weight: 500;
}

.sai-prod-action .sai-btn-consult {
    width: 100%;
    background: #f0f2f5;
    color: #1877f2;
    border: 1px solid #d8dadf;
    border-radius: 6px;
    padding: 9px 0;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sai-prod-action .sai-btn-consult:hover {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

/* Section: Photos Grid */
.sai-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.sai-photo-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 180px;
    background: #e4e6eb;
}

.sai-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sai-photo-item:hover img {
    transform: scale(1.05);
}

.sai-photo-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.sai-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Section: Videos Grid */
.sai-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.sai-video-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e4e6eb;
    background: #ffffff;
}

.sai-video-thumb {
    height: 190px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sai-play-btn {
    width: 52px;
    height: 52px;
    background: rgba(0,0,0,0.65);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    padding-left: 4px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.sai-video-thumb:hover .sai-play-btn {
    transform: scale(1.1);
    background: #1877f2;
}

.sai-video-dur {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.sai-video-meta {
    padding: 14px 16px;
}

.sai-video-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.sai-video-info {
    font-size: 0.775rem;
    color: #65676b;
}

/* Section: Followers Grid */
.sai-followers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sai-follower-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #e4e6eb;
    background: #f7f8fa;
}

.sai-fl-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sai-fl-info {
    flex: 1;
    min-width: 0;
}

.sai-fl-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #050505;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sai-fl-sub {
    font-size: 0.75rem;
    color: #65676b;
}

.sai-fl-btn {
    background: #e4e6eb;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #050505;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sai-fl-btn:hover {
    background: #d8dadf;
}


/* ========================================================================= */
/* COMPACT CLEAN FORM STYLING (Tối giản chữ thừa, gọn gàng chuẩn Facebook)  */
/* ========================================================================= */
.sai-help-text,
.sai-preview-tip,
.sai-comm-subtitle,
.sai-pages-form-subtitle,
.sai-theme-badge-box {
    display: none !important;
}

.sai-form-card {
    padding: 20px 24px !important;
}

.sai-form-header {
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
}

.sai-pages-form-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 8px 0 0 0 !important;
}

.sai-form-group {
    margin-bottom: 14px !important;
}

.sai-label {
    margin-bottom: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.sai-final-url-box {
    margin-top: 6px !important;
    padding: 8px 12px !important;
}
