/* RESET */
.fswrt-wrapper { display: flex; font-family: 'Inter', sans-serif; background: #f3f4f6; margin-left: -20px; min-height: 100vh; }
.fswrt-sidebar { width: 260px; background: #fff; border-right: 1px solid #e5e7eb; padding: 20px; display: flex; flex-direction: column; }
.fswrt-main { flex: 1; padding: 30px 40px; }

/* SIDEBAR ITEMS */
.fswrt-logo { font-size: 20px; font-weight: 700; color: #4f46e5; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.fswrt-logo small { font-size: 12px; color: #9ca3af; font-weight: normal; margin-left: 5px; }
.fswrt-nav .nav-item { display: flex; align-items: center; padding: 12px 15px; color: #6b7280; text-decoration: none; border-radius: 8px; margin-bottom: 5px; font-weight: 500; cursor: pointer; transition: 0.2s; }
.fswrt-nav .nav-item:hover, .fswrt-nav .nav-item.active { background: #eef2ff; color: #4f46e5; }
.fswrt-nav .dashicons { margin-right: 10px; }

/* USER PROFILE */
.fswrt-user-profile { margin-top: auto; background: #111827; color: #fff; padding: 15px; border-radius: 12px; }
.user-info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #6366f1; object-fit: cover; }
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: bold; font-size: 14px; color: #fff; }
.credits-bar { height: 6px; background: #374151; border-radius: 3px; margin: 8px 0; overflow: hidden; }
.credits-bar .fill { background: #22c55e; height: 100%; }
.dev-link { font-size: 11px; color: #9ca3af; display: block; margin-top: 10px; text-decoration: none; border-top: 1px solid #374151; padding-top: 10px; }
.dev-link:hover { color: #fff; }

/* HEADER & CARD */
.fswrt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.fswrt-header h2 { font-size: 24px; margin: 0; color: #111827; }
.api-status { padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid #ccc; display:flex; align-items:center; gap:5px; }
.api-status.connected { background: #dcfce7; color: #166534; }
.api-status.disconnected { background: #fee2e2; color: #991b1b; }
.dot { height: 8px; width: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

.fswrt-content-card { background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin-bottom: 20px; }

/* GRID SYSTEM */
.form-grid { display: flex; gap: 40px; align-items: flex-end; }
.col-left, .col-right { flex: 1; min-width: 0; }
label { display: block; font-weight: 600; font-size: 14px; color: #374151; margin-bottom: 8px; margin-top: 20px; }
input[type="text"], input[type="password"], select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #f9fafb; box-sizing: border-box; }

/* TEXTAREA */
.fswrt-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}
.fswrt-textarea:focus { border-color: #6366f1; outline: none; background: #fff; }

/* SLIDER */
.slider-container { margin-top: 0; }
.range-wrap { position: relative; margin-bottom: 30px; }
.range-slider { -webkit-appearance: none; width: 100%; height: 6px; background: #e5e7eb; border-radius: 5px; outline: none; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; background: #4f46e5; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4); }
.bubble { background: #111827; color: white; padding: 4px 10px; position: absolute; border-radius: 4px; top: -35px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: bold; }
.bubble::after { content: ""; position: absolute; border: 5px solid transparent; border-top-color: #111827; bottom: -10px; left: 50%; transform: translateX(-50%); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: #9ca3af; margin-top: -5px; }

/* TOGGLE & SELECTORS */
.model-selector { display: flex; gap: 15px; }
.model-option { flex: 1; border: 1px solid #d1d5db; padding: 10px; border-radius: 8px; cursor: pointer; text-align: center; display:flex; align-items:center; justify-content:center; gap:8px; }
.model-option.active { border-color: #6366f1; background: #eef2ff; color: #4f46e5; font-weight: bold; }
.model-option input { display: none; }

/* GLOWING DOTS */
.status-dot { height: 8px; width: 8px; border-radius: 50%; display: inline-block; background: #d1d5db; }
.status-dot.active { background: #22c55e; box-shadow: 0 0 5px #22c55e; animation: pulse-green 2s infinite; }
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* FEATURE BOX */
.feature-toggle-box { background: #f9fafb; padding: 15px; border-radius: 8px; display: flex; align-items: center; gap: 15px; border: 1px solid #e5e7eb; width: 100%; box-sizing: border-box; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; margin-left: auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
input:checked + .slider { background-color: #4f46e5; }
input:checked + .slider:before { transform: translateX(20px); content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .4s; }

/* BUTTONS & HELPERS */
.btn-primary { width: 100%; background: #4f46e5; color: white; padding: 16px; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 30px; display: flex; justify-content: center; gap: 10px; }
.keyword-row { position: relative; margin-bottom: 8px; }
.btn-remove { position: absolute; right: 10px; top: 10px; border: none; color: #ef4444; background: transparent; cursor: pointer; font-size: 16px; }
.text-link-btn { background: none; border: none; color: #4f46e5; cursor: pointer; font-size: 13px; font-weight: 500; }
.flex-row { display: flex; gap: 15px; } .half { flex: 1; }

/* EDITOR */
.result-header-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #eee; margin-bottom: 10px; }
.wp-editor-wrapper { border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; margin-top: 15px; }
.save-msg { color: #166534; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.badge-status { padding: 3px 8px; border-radius: 10px; font-size: 11px; color: #fff; font-weight: bold; }
.badge-status.draft { background: #f59e0b; } .badge-status.publish { background: #10b981; }
.btn-small { border: 1px solid #ddd; padding: 5px 10px; border-radius: 4px; text-decoration: none; color: #333; font-size: 12px; }
.spin { animation: spin 2s infinite linear; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* FORCE SELECT WIDTH */
.fswrt-content-card select#fswrt_img_engine {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}