/* Settings Page Styles */
.aifi-settings-page { max-width: 1400px; }

/* Tab Navigation */
.aifi-tabs-nav {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}
.aifi-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}
.aifi-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}
.aifi-tab-active {
    color: #667eea;
    border-bottom-color: #667eea;
}
.aifi-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.aifi-pro-badge-tab {
    background: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%);
    color: #1a1a2e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Header */
.aifi-settings-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px 40px;
    margin: 20px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}
.aifi-settings-header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    margin: 0 0 8px;
    font-size: 26px;
}
.aifi-settings-header h1 .dashicons { font-size: 28px; width: 28px; height: 28px; }
.aifi-settings-header p { margin: 0; opacity: 0.9; font-size: 15px; max-width: 600px; }
.aifi-pro-badge-header {
    background: linear-gradient(135deg, #f0ad4e 0%, #ec971f 100%);
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.aifi-pro-badge-header .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* Setup Notice */
.aifi-setup-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.aifi-setup-notice > .dashicons {
    color: #f59e0b;
    font-size: 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
}
.aifi-setup-notice-content strong { display: block; margin-bottom: 4px; color: #92400e; }
.aifi-setup-notice-content p { margin: 0; color: #a16207; }
.aifi-setup-notice-content a { color: #92400e; font-weight: 500; }

/* Layout */
.aifi-settings-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* Main Settings Card */
.aifi-settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}
.aifi-settings-form {
    padding: 0;
}
.aifi-settings-form .form-table {
    margin: 0;
}
.aifi-settings-form .form-table th {
    padding: 20px 20px 20px 30px;
    width: 220px;
    font-weight: 500;
}
.aifi-settings-form .form-table td {
    padding: 20px 30px 20px 10px;
}
.aifi-settings-form .form-table tr {
    border-bottom: 1px solid #f3f4f6;
}
.aifi-settings-form .form-table tr:last-child {
    border-bottom: none;
}
.aifi-settings-form h2 {
    background: #f8f9fa;
    margin: 0;
    padding: 20px 30px;
    font-size: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.aifi-settings-submit {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
}
.aifi-settings-submit .button-primary {
    padding: 8px 24px;
    height: auto;
    font-size: 14px;
}

/* Sidebar */
.aifi-settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.aifi-sidebar-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}
.aifi-sidebar-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
}
.aifi-sidebar-card h3 .dashicons {
    color: #667eea;
    font-size: 18px;
    width: 18px;
    height: 18px;
}
.aifi-sidebar-card p {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}
.aifi-sidebar-card-highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #7dd3fc;
}

/* Tips List */
.aifi-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.aifi-tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}
.aifi-tips-list li:last-child { margin-bottom: 0; }
.aifi-tips-list .dashicons {
    color: #10b981;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.aifi-tips-list .aifi-tip-pro .dashicons {
    color: #f0ad4e;
}
.aifi-tips-list .aifi-tip-pro {
    color: #6b7280;
}

/* Sidebar Buttons */
.aifi-sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aifi-sidebar-buttons .button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.aifi-sidebar-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Links List */
.aifi-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.aifi-links-list li { margin-bottom: 10px; }
.aifi-links-list li:last-child { margin-bottom: 0; }
.aifi-links-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
}
.aifi-links-list a:hover { color: #667eea; }
.aifi-links-list .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #9ca3af;
}

/* Upgrade Card */
.aifi-sidebar-upgrade {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
    text-align: center;
}
.aifi-sidebar-upgrade h3 {
    color: #5b21b6;
    justify-content: center;
}
.aifi-sidebar-upgrade h3 .dashicons {
    color: #7c3aed;
}
.aifi-sidebar-upgrade p { color: #6b7280; }
.aifi-upgrade-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.aifi-sidebar-upgrade .button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 10px 24px;
    height: auto;
    width: 100%;
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}
.aifi-sidebar-upgrade .button-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Custom Styles table */
.aifi-custom-styles-wrap { max-width: 700px; }
.aifi-custom-styles-table { border-collapse: collapse; margin-bottom: 8px; }
.aifi-custom-styles-table th,
.aifi-custom-styles-table td { padding: 6px 8px; }
.aifi-custom-styles-table th { font-weight: 600; background: #f9fafb; }
.aifi-custom-styles-table tbody tr:nth-child(even) { background: #f9fafb; }
.aifi-remove-custom-style {
    padding: 4px 6px !important;
    min-height: unset !important;
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    background: transparent !important;
    line-height: 1 !important;
}
.aifi-remove-custom-style:hover {
    background: #fef2f2 !important;
}
.aifi-remove-custom-style .dashicons { font-size: 16px; width: 16px; height: 16px; vertical-align: middle; }

/* Disabled Pro options in dropdowns */
.aifi-settings-form select option:disabled {
    color: #9ca3af;
    font-style: italic;
}

/* Field enhancements */
.aifi-settings-form select,
.aifi-settings-form input[type="text"],
.aifi-settings-form input[type="password"] {
    min-width: 300px;
}
.aifi-settings-form .description {
    margin-top: 8px;
    color: #6b7280;
}

/* Test Connection Button */
.aifi-test-key-btn {
    margin-left: 8px;
    vertical-align: middle;
}
.aifi-test-key-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 2px;
}
.aifi-test-key-result {
    font-size: 13px;
    font-weight: 500;
    vertical-align: middle;
}

/* Pro Notice (Inline Images tab) */
.aifi-pro-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.aifi-pro-notice .dashicons {
    color: #f59e0b;
    font-size: 22px;
    width: 22px;
    height: 22px;
}
.aifi-pro-notice strong { display: block; margin-bottom: 4px; color: #92400e; }
.aifi-pro-notice p { margin: 0; color: #a16207; }
.aifi-pro-notice a { color: #92400e; font-weight: 500; }

/* Inline Images Upsell Panel */
.aifi-inline-upsell {
    text-align: center;
    padding: 40px 30px;
}
.aifi-inline-upsell-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #667eea;
    background: #f5f3ff;
    border-radius: 50%;
    padding: 16px;
    margin-bottom: 16px;
}
.aifi-inline-upsell h3 {
    font-size: 20px;
    margin: 0 0 10px;
    color: #1f2937;
}
.aifi-inline-upsell > p {
    font-size: 14px;
    color: #6b7280;
    max-width: 500px;
    margin: 0 auto 24px;
}
.aifi-inline-upsell-features {
    list-style: none;
    padding: 0;
    margin: 0 auto 28px;
    max-width: 380px;
    text-align: left;
}
.aifi-inline-upsell-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: #374151;
}
.aifi-inline-upsell-features .dashicons {
    color: #059669;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.aifi-inline-upsell .button-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    text-shadow: none;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}
.aifi-inline-upsell .button-hero:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Save confirmation notice */
.aifi-save-notice {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-left: 4px solid #10b981;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #065f46;
    font-weight: 500;
}
.aifi-save-notice .dashicons {
    color: #10b981;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Section description text alignment */
.aifi-settings-form h2 + p {
    margin: 0;
    padding: 12px 30px 16px;
    color: #6b7280;
    font-size: 13px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 1100px) {
    .aifi-settings-layout {
        grid-template-columns: 1fr;
    }
    .aifi-settings-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 782px) {
    .aifi-settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 24px;
    }
    .aifi-settings-form .form-table th,
    .aifi-settings-form .form-table td {
        display: block;
        width: 100%;
        padding: 12px 20px;
    }
    .aifi-settings-form .form-table th {
        padding-bottom: 4px;
    }
    .aifi-settings-form select,
    .aifi-settings-form input[type="text"],
    .aifi-settings-form input[type="password"] {
        min-width: 100%;
        width: 100%;
    }
    .aifi-settings-form h2 + p {
        padding: 12px 20px 16px;
    }
}

/* Provider capabilities notice */
.aifi-capabilities-notice {
    background: #f0f6fc;
    border: 1px solid #c3d4e5;
    border-left: 4px solid #2271b1;
    padding: 10px 14px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.6;
    color: #1d2327;
    margin-bottom: 6px;
}

.aifi-capabilities-notice .dashicons {
    color: #2271b1;
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: text-bottom;
}

/* Auto-optimization notice */
.aifi-auto-optimize-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #f0f6fc;
    border: 1px solid #c3d4e5;
    border-left: 4px solid #2271b1;
    padding: 14px 18px;
    border-radius: 4px;
    margin-top: 12px;
}
.aifi-auto-optimize-notice > .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}
.aifi-auto-optimize-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #1d2327;
    font-size: 13px;
}
.aifi-auto-optimize-notice p {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

/* Review request notice (shared with admin.css) */
.aifi-review-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff8e5 100%);
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    margin: 16px 20px 5px 0;
}
.aifi-review-notice.aifi-review-hiding {
    opacity: 0;
    transition: opacity 250ms ease;
}
.aifi-review-notice-icon .dashicons {
    color: #f59e0b;
    font-size: 24px;
    width: 24px;
    height: 24px;
}
.aifi-review-notice-body { flex: 1; }
.aifi-review-notice-title {
    margin: 0 0 4px;
    font-size: 14px;
    color: #92400e;
}
.aifi-review-notice-text {
    margin: 0 0 10px;
    color: #78350f;
    font-size: 13px;
    line-height: 1.55;
    max-width: 720px;
}
.aifi-review-notice-actions {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.aifi-review-notice-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: text-bottom;
}
.aifi-review-notice-never {
    color: #78350f !important;
    text-decoration: underline;
    font-size: 12px;
}
.aifi-review-notice-never:hover {
    color: #92400e !important;
}
