/* SBPAI Modern UI Styles Reset & Font */
.sbpai-app {
    font-family: 'Inter', sans-serif;
    color: #374151; /* Dark grey */
    margin-right: 20px;
    margin-top: 20px;
    /* Soft variables */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-surface: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sbpai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 15px 0px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sbpai-header .sbpai-logo {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0px;
    color: #111827;
}

.sbpai-header .sbpai-logo span.dashicons {
    color: var(--primary);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sbpai-header .sbpai-nav {
    display: flex;
    gap: 10px;
}

.sbpai-header .sbpai-nav a {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sbpai-header .sbpai-nav a:hover {
    background: #e5e7eb;
    color: #111827;
}

.sbpai-header .sbpai-nav a.active {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.sbpai-view-container {
    animation: fadein 0.3s ease forwards;
}

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

.sbpai-view-header {
    margin-bottom: 20px;
}
.sbpai-view-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: #111827;
}
.sbpai-view-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 5px 0 0 0;
}

/* Tab Nav inspired by screenshot */
.sbpai-tab-nav {
    display: flex;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--border);
}

.sbpai-tab-nav a {
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-bottom: none;
    margin-right: 5px;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
}

.sbpai-tab-nav a.active {
    background: #f3f4f6; /* Matching WP background */
    color: #111827;
    border-bottom: 1px solid #f3f4f6; /* hides bottom border */
}

/* Row Settings Layout */
.sbpai-settings-form {
    padding: 20px 0;
}

.sbpai-settings-form .form-row {
    display: flex;
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
}

.sbpai-settings-form .form-row:last-child {
    border-bottom: none;
}

.sbpai-settings-form .form-row > label {
    width: 220px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    padding-top: 5px;
    flex-shrink: 0;
}

.sbpai-settings-form .input-wrap {
    flex-grow: 1;
}

.sbpai-settings-form .input-wrap .description {
    color: #6b7280;
    font-size: 13px;
    margin: 8px 0 0 0;
}

.sbpai-settings-form .date-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sbpai-input {
    border-radius: 4px;
    border: 1px solid #d1d5db;
    padding: 6px 10px;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: #fff;
    font-size: 14px;
    height: 32px;
}

.sbpai-settings-form .input-wrap input[type="checkbox"] {
    margin-top: 5px;
}

.sbpai-settings-form .submit-row {
    padding-top: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Poller Bar */
.sbpai-global-poller {
    background: #fff;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.poller-text {
    font-weight: 600;
    font-size: 14px;
}

.poller-bar {
    flex-grow: 1;
    background: #e5e7eb;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.poller-progress {
    background: var(--primary);
    width: 100%;
    height: 100%;
    animation: indeterminate 1.5s infinite linear;
    transform-origin: 0% 50%;
}

@keyframes indeterminate {
    0% { transform:  translateX(-100%) scaleX(0.2); }
    40% { transform:  translateX(0) scaleX(0.4); }
    100% { transform:  translateX(100%) scaleX(0.2); }
}

.sbpai-btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s, transform 0.1s;
    font-family: 'Inter', sans-serif;
    display: inline-block;
}
.sbpai-btn:active { transform: scale(0.98); }
.sbpai-btn-primary { background: #10b981; color: #fff; } /* Match original image green */
.sbpai-btn-primary:hover { background: #059669; color:#fff; }

.sbpai-progress { font-weight: 500; color: #10b981; }

/* Global Grid System */
.sbpai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.sbpai-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); }

/* Form Table overrides */
.sbpai-form-table {
    width: 100%;
    border-collapse: collapse;
}

.sbpai-form-table th {
    text-align: left;
    vertical-align: top;
    width: 250px;
    padding: 20px 20px 20px 20px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.sbpai-form-table td {
    padding: 20px 20px 20px 0;
    vertical-align: top;
}

.sbpai-form-table tr {
    border-bottom: 1px solid var(--border);
}

.sbpai-form-table tr:last-child {
    border-bottom: none;
}

.sbpai-table-section-head td {
    padding-top: 30px;
    padding-bottom: 5px;
    padding-left: 20px;
}

.sbpai-table-section-head h3 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

/* Eradication spin animation */
@keyframes sbpai-spin { 
    100% { transform: rotate(360deg); } 
}

