/* assets/admin.css - Enhanced UI */

/* --- LAYOUT & CONTAINER --- */
.smallpict-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1200px;
    margin: 20px auto;
}

.smallpict-header {
    background: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 25px;
    border-left: 5px solid #2271b1;
    /* WP Blue Brand */
    gap: 20px;
}

.sp-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.smallpict-title h1 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.smallpict-status {
    margin-left: auto;
    /* Push to right */
}

.smallpict-badge {
    background: #f0f0f1;
    color: #50575e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smallpict-badge.pro {
    background: #e0f7fa;
    color: #006064;
    border: 1px solid #b2ebf2;
    color: #2271b1;
}

/* --- TABS --- */
.sp-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #dcdcde;
    margin-bottom: 25px;
    padding-left: 10px;
}

.sp-tab {
    padding: 10px 15px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.sp-tab.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.sp-tab:hover {
    color: #2271b1;
}

/* --- GRID SYSTEM --- */
.smallpict-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    /* Optimized ratio */
    gap: 30px;
    align-items: start;
}

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

/* --- CARDS --- */
.smallpict-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #dcdcde;
    overflow: hidden;
    /* For header radius */
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f1;
    background: #fff;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
    font-weight: 600;
}

.card-subtitle {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #646970;
}

.sp-input-group,
.sp-settings-block {
    padding: 25px;
}

.sp-settings-block {
    border-bottom: 1px solid #f0f0f1;
}

.sp-settings-block.no-border {
    border-bottom: none;
}

.block-title {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #1d2327;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* --- FORM ELEMENTS --- */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label,
.form-col label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #3c434a;
    font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    /* WP Standard border */
    border-radius: 4px;
    font-size: 14px;
    color: #2c3338;
    background: #fff;
    box-shadow: 0 0 0 transparent;
    transition: box-shadow .1s linear;
}

input:focus,
select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* --- PRO SECTION STYLING --- */
.pro-section {
    border-top: 3px solid #72aee6;
}

.pro-locked input,
.pro-locked select {
    background-color: #f6f7f7;
    color: #a7aaad;
    cursor: not-allowed;
    border-color: #dcdcde;
}

.pro-badge-label {
    float: right;
    font-size: 10px;
    background: #2271b1;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

/* --- ACTIONS (SIDEBAR) --- */
.sp-actions-card {
    border: none;
    box-shadow: none;
    background: transparent;
}

.sp-actions-card .card-header {
    background: transparent;
    border: none;
    padding: 0 0 15px 0;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-item {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.action-icon {
    font-size: 24px;
    line-height: 1;
}

.action-content {
    flex: 1;
}

.action-content h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.action-content p {
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #646970;
}

.btn-full {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* --- INFO CARD --- */
.sp-info-card {
    padding: 20px;
    text-align: center;
    color: #646970;
    font-size: 12px;
}

.sp-info-card h3 {
    margin-top: 0;
    font-size: 14px;
}

/* --- CONSOLE LOG BOX --- */
.smallpict-log-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-family: 'Consolas', 'Monaco', monospace;
    background: #fff;
    border: 1px solid #dcdcde;
}

/* Success State */
.smallpict-log-box.sp-success {
    background-color: #f0f9eb;
    color: #155724;
    border-left: 5px solid #4ab866;
}

/* Error State */
.smallpict-log-box.sp-error {
    background-color: #fef0f0;
    color: #b91c1c;
    border-left: 5px solid #d63638;
}

#test-result {
    margin-top: 10px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
}

/* [UI FIX] Hide default WP notices that leak into the page */
/* We handle our own notices inside .smallpict-wrap */
span.smallpict-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    background: #e5e5e5;
    color: #555;
}

span.smallpict-badge.pro {
    background: #e0f7fa;
    color: #006064;
    border: 1px solid #b2ebf2;
}

/* [UI FIX] Aggressively hide default WP notices on this specific page */
/* targeting body.settings_page_smallpict ensures we don't break other admin pages */
body.settings_page_smallpict #wpbody-content>.notice,
body.settings_page_smallpict .wrap>.notice,
body.settings_page_smallpict #wpbody-content>.updated,
body.settings_page_smallpict #wpbody-content>.error {
    display: none !important;
}

/* Ensure OUR custom notices inside the wrapper are visible */
.smallpict-wrap .notice {
    display: block !important;
}