/**
 * New UI Admin Styles
 * 
 * Styles for the redesigned admin pages
 * 
 * @package All_Sources_Images
 * @since 6.2.0
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --asi-primary: #3699FF;
    --asi-primary-light: #E1F0FF;
    --asi-success: #1BC5BD;
    --asi-success-light: #C9F7F5;
    --asi-warning: #FFA800;
    --asi-warning-light: #FFF4DE;
    --asi-danger: #F64E60;
    --asi-danger-light: #FFE2E5;
    --asi-info: #8950FC;
    --asi-info-light: #EEE5FF;
    --asi-dark: #181C32;
    --asi-gray-100: #F3F6F9;
    --asi-gray-200: #EBEDF3;
    --asi-gray-300: #E4E6EF;
    --asi-gray-400: #D1D3E0;
    --asi-gray-500: #B5B5C3;
    --asi-gray-600: #7E8299;
    --asi-gray-700: #5E6278;
    --asi-gray-800: #3F4254;
    --asi-gray-900: #181C32;
    --asi-border-radius: 8px;
    --asi-box-shadow: 0 0 30px 0 rgba(82, 63, 105, 0.05);
}

/* ==========================================================================
   Top Navigation Tabs (above card)
   ========================================================================== */
.nav-tabs-line.nav-tabs-primary {
    display: flex;
    gap: 0;
    margin-top: 20px;
}

.nav-tabs-line.nav-tabs-primary .nav-item {
    margin-bottom: 0;
}

.nav-tabs-line.nav-tabs-primary .nav-link {
    display: block;
    padding: 12px 25px;
    background: #e4e6ef;
    color: #7e8299;
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-tabs-line.nav-tabs-primary .nav-link:hover {
    background: #f3f6f9;
    color: #3699ff;
}

.nav-tabs-line.nav-tabs-primary .nav-link.active {
    background: #ffffff;
    color: #3699ff;
    font-weight: 600;
}

/* Card connected to tabs - remove top margin */
.nav-tabs-line.nav-tabs-primary + .card.card-custom {
    margin-top: 0 !important;
}

/* ==========================================================================
   Base Layout
   ========================================================================== */
.allsi-new-settings,
.allsi-new-automatic,
.new-bulk-generation-wrap {
    margin: 20px 20px 20px 0;
}

.allsi-new-settings h1,
.allsi-new-automatic h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--asi-dark);
    margin-bottom: 20px;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */
.allsi-nav-tabs {
    border-bottom: 2px solid var(--asi-gray-200);
    margin-bottom: 20px;
    padding-bottom: 0;
}

.allsi-nav-tabs .nav-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--asi-gray-600);
    font-weight: 500;
    margin-bottom: -2px;
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.allsi-nav-tabs .nav-tab:hover {
    background: var(--asi-gray-100);
    color: var(--asi-primary);
}

.allsi-nav-tabs .nav-tab-active,
.allsi-nav-tabs .nav-tab-active:hover {
    background: transparent;
    border-bottom-color: var(--asi-primary);
    color: var(--asi-primary);
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.allsi-alert {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-radius: var(--asi-border-radius);
    margin-bottom: 20px;
}

.allsi-alert-icon {
    flex-shrink: 0;
    margin-right: 15px;
}

.allsi-alert-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.allsi-alert-content {
    flex: 1;
}

.allsi-alert-content strong {
    display: block;
    margin-bottom: 5px;
}

.allsi-alert-content p {
    margin: 0 0 10px;
}

.allsi-alert-content p:last-child {
    margin-bottom: 0;
}

.allsi-alert-primary {
    background: var(--asi-primary-light);
    color: var(--asi-primary);
}

.allsi-alert-info {
    background: var(--asi-info-light);
    color: var(--asi-info);
}

.allsi-alert-success {
    background: var(--asi-success-light);
    color: var(--asi-success);
}

.allsi-alert-warning {
    background: var(--asi-warning-light);
    color: var(--asi-warning);
}

.allsi-alert-danger {
    background: var(--asi-danger-light);
    color: var(--asi-danger);
}

/* Feature List in Alerts */
.allsi-feature-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.allsi-feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.allsi-feature-list li:last-child {
    margin-bottom: 0;
}

.allsi-feature-list .dashicons {
    margin-right: 8px;
    font-size: 18px;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.allsi-card {
    background: #fff;
    border-radius: var(--asi-border-radius);
    box-shadow: var(--asi-box-shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.allsi-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--asi-dark);
    margin: 0 0 15px;
    display: flex;
    align-items: center;
}

.allsi-card-title .dashicons {
    margin-right: 10px;
    color: var(--asi-primary);
}

/* ==========================================================================
   Source Lists
   ========================================================================== */
.allsi-source-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.allsi-source-list li {
    padding: 10px 15px;
    margin-bottom: 5px;
    background: var(--asi-gray-100);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.allsi-source-list li:hover {
    background: var(--asi-gray-200);
}

.allsi-source-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.allsi-source-list input[type="checkbox"] {
    margin-right: 10px;
}

/* Source Badges */
.allsi-source-badge {
    display: inline-flex;
    align-items: center;
    background: var(--asi-info-light);
    color: var(--asi-info);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.allsi-source-dot {
    width: 6px;
    height: 6px;
    background: var(--asi-info);
    border-radius: 50%;
    margin-right: 5px;
}

/* Disabled Sources */
.checkbox-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-disabled input {
    cursor: not-allowed;
}

/* ==========================================================================
   Form Tables
   ========================================================================== */
.allsi-tab-content .form-table th {
    padding: 15px 10px 15px 0;
    width: 200px;
}

.allsi-tab-content .form-table td {
    padding: 15px 10px;
}

.allsi-tab-content .form-table tr {
    border-bottom: 1px solid var(--asi-gray-200);
}

.allsi-tab-content .form-table tr:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.allsi-tab-content input[type="text"],
.allsi-tab-content input[type="password"],
.allsi-tab-content input[type="number"],
.allsi-tab-content select,
.allsi-tab-content textarea {
    border: 1px solid var(--asi-gray-300);
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.allsi-tab-content input[type="text"]:focus,
.allsi-tab-content input[type="password"]:focus,
.allsi-tab-content input[type="number"]:focus,
.allsi-tab-content select:focus,
.allsi-tab-content textarea:focus {
    border-color: var(--asi-primary);
    box-shadow: 0 0 0 3px var(--asi-primary-light);
    outline: none;
}

.allsi-tab-content .allsi-log-viewer-textarea {
    font-family: Consolas, Monaco, monospace;
    text-align: left;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    word-break: normal;
    resize: vertical;
}

/* Checkboxes */
.allsi-tab-content .checkbox,
.allsi-tab-content .radio {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.allsi-tab-content .checkbox input,
.allsi-tab-content .radio input {
    margin-right: 8px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.allsi-tab-content .button-primary {
    background: var(--asi-primary);
    border-color: var(--asi-primary);
    border-radius: 6px;
    padding: 8px 20px;
    height: auto;
    transition: all 0.2s ease;
}

.allsi-tab-content .button-primary:hover {
    background: #2684FF;
    border-color: #2684FF;
}

/* ==========================================================================
   Tab Content Sections
   ========================================================================== */
.new-automatic-sources-tab,
.new-automatic-plugins-tab,
.new-automatic-image-placement-tab,
.new-automatic-post-processing-tab,
.new-automatic-pre-processing-tab,
.new-settings-source-tab,
.new-settings-proxy-tab,
.new-settings-others-tab {
    background: #fff;
    border-radius: var(--asi-border-radius);
    box-shadow: var(--asi-box-shadow);
    padding: 20px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 782px) {
    .allsi-new-settings,
    .allsi-new-automatic,
    .new-bulk-generation-wrap {
        margin: 10px;
    }
    
    .allsi-nav-tabs .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .allsi-tab-content .form-table th {
        width: 100%;
        display: block;
        padding-bottom: 5px;
    }
    
    .allsi-tab-content .form-table td {
        display: block;
        padding-top: 0;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--asi-gray-600);
}

.text-primary {
    color: var(--asi-primary);
}

.text-success {
    color: var(--asi-success);
}

.text-warning {
    color: var(--asi-warning);
}

.text-danger {
    color: var(--asi-danger);
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ==========================================================================
   jQuery UI Tabs Base Styles (Required for functionality)
   ========================================================================== */
.ui-tabs {
    position: relative;
    padding: 0;
}
.ui-tabs .ui-tabs-nav {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}
.ui-tabs .ui-tabs-nav li {
    list-style: none;
    position: relative;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}
.ui-tabs .ui-tabs-nav li a {
    display: block;
    text-decoration: none;
    cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
    display: block;
    padding: 1em;
}
.ui-tabs .ui-tabs-hide,
.ui-tabs-panel[aria-hidden="true"] {
    display: none !important;
}

/* ==========================================================================
   jQuery UI Tabs Override - Source Settings
   ========================================================================== */
.new-settings-source-tab #tabs,
.new-automatic-sources-tab #tabs {
    background: #fff;
    border: 1px solid var(--asi-gray-300);
    border-radius: var(--asi-border-radius);
    padding: 0;
    margin-top: 15px;
}

.new-settings-source-tab #tabs .ui-tabs-nav,
.new-automatic-sources-tab #tabs .ui-tabs-nav {
    background: var(--asi-gray-100);
    border: none;
    border-bottom: 1px solid var(--asi-gray-300);
    border-radius: var(--asi-border-radius) var(--asi-border-radius) 0 0;
    padding: 10px 10px 0;
    margin: 0;
}

.new-settings-source-tab #tabs .ui-tabs-nav li,
.new-automatic-sources-tab #tabs .ui-tabs-nav li {
    background: transparent;
    border: none;
    border-radius: 6px 6px 0 0;
    margin: 0 2px -1px 0;
}

.new-settings-source-tab #tabs .ui-tabs-nav li a,
.new-automatic-sources-tab #tabs .ui-tabs-nav li a {
    padding: 10px 18px;
    color: var(--asi-gray-600);
    font-weight: 500;
    border: none;
    background: transparent;
    outline: none;
}

.new-settings-source-tab #tabs .ui-tabs-nav li a:hover,
.new-automatic-sources-tab #tabs .ui-tabs-nav li a:hover {
    color: var(--asi-primary);
    background: rgba(54, 153, 255, 0.1);
}

.new-settings-source-tab #tabs .ui-tabs-nav li.ui-tabs-active,
.new-automatic-sources-tab #tabs .ui-tabs-nav li.ui-tabs-active {
    background: #fff;
    border: 1px solid var(--asi-gray-300);
    border-bottom-color: #fff;
    margin-bottom: -1px;
}

.new-settings-source-tab #tabs .ui-tabs-nav li.ui-tabs-active a,
.new-automatic-sources-tab #tabs .ui-tabs-nav li.ui-tabs-active a {
    color: var(--asi-primary);
    font-weight: 600;
}

.new-settings-source-tab #tabs .ui-tabs-panel,
.new-automatic-sources-tab #tabs .ui-tabs-panel,
.new-settings-source-tab #tabs > table.form-table,
.new-automatic-sources-tab #tabs > table.form-table {
    padding: 20px;
    border: none;
    background: #fff;
}

/* Source Logo in tabs */
.new-settings-source-tab .source-logo img,
.new-automatic-sources-tab .source-logo img {
    max-height: 40px;
    width: auto;
}

/* Password toggle icon - Eye to show/hide API key */
/* Eye to show/hide API key - Copied from original CSS */
.password input.form-control {
  width: 90%;
  margin-left: 47px;
}

form i#togglePassword {
  margin-right: 2px;
  margin-top: -38px;
  float: left;
  cursor: pointer;
  height: 38px;
  background-repeat: no-repeat;
  width: 50px;
  background-color: #dee2e6 !important;
  border: solid 11px;
  border-radius: 30px 0 0 30px;
  color: #dee2e6;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAd5JREFUOE9tk0GIzVEUxn9fjYWQMqSkJBuKWamHaIqy8lYWVrOwI9lI2cjzlKw0K5RSmpSlpGwsJGpmoSklq1mQ7IyiYfPUp3Puve/9p/xX93/uOd/57ne+IwABjsP4E5Kx601LEMiRO7mPUJZLwg0m0URGxujln3V5EVvXt9IJSLNdsLtg6avsVUuVQQQLZ3URLDYLLtvMCQ6Mn5VZ/oRZAO4JrTW2nXqdQixg7wL9FB4YvUra6CT4utFO4JvwnOF1FDeAs4KnwAbDKnAY8Vmmb3EQ86TKtgxMg0bgc8Cz0G7GZgnYWOU4L3icSuObRgNwgPYEs0aPihD6g3wkGLwVOp5EY3Rom+yepb2YIbAjBRPzWLfB3xttw7toswLsK6KmWJuAu0IXitYJHaeHElds1ia+0Uqc+4Ln2aN8pwW/gTeGqRr7C8wKtlp6GTMOO9icySJJQ+MbpZneY58AjiIuFfbcNywilrH2F64eALfKhEvkKnAHMyXxAXMRtJiqwDHggWEGGAHXBPP10c3X6apDNkNBv9L/leYzWwQjwwtBdP7YTFbMnIaf2BM0Lblns6f69Qv2ktAPxwgzNRqXjen4u7uZbcnKG8ssii+zoCA35f+70N0RjhfHKepkc/8B2xbLMrJY+1IAAAAASUVORK5CYII=');
  background-repeat: no-repeat;
  background-position: 7px 0;
}

form i#togglePassword.close-eye {
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAe5JREFUOE9lk0+IzXEUxT/HhJoeGyVpJLObjRlWYzuyUCxoakQ2kmT8KSu2mp2NFKV5C2p6aWIhZUeJsqBGsjIlGUsTUtM8ydG93+/7zYvf4te37z3fe88991yJ8jl+Ujn0LjOQkbwqmPogjs4nJeT/EC4RBVA40CVXJilwZc15wwpwDmklUX3A5hzgKNQjULNHrjvgM4J3wKTFotB6m73gnYKNhk/Aa8Fq024SSQbJ55TtW0BX0DEcAW0DlpAHZLYbfgBtYAb4XvrINpvm9wAPgGFJPw0T2G9qeAx0F3lU5gPoEHgxNaiAqPYNGATdkziM/RyxYHNUYgbzGPHeZguwDIwBX0LEdYZniEHMpGDJ6Krka8BAMLT5Ax4FzgLTVcenSAckscvwMSWxlx3V4ZXMfkMH2FrbPe44w41mlng4NZCYtX26Zu4ITtR5D9nMC+1DfmRrFTyVfrPmwCdzCsabQC/Bu0Fd4XGjt9WjG4DrEhfDVekEaQEzEdPoN+Zm8H3gIPAVuCJ44hBM+oU5Vpm2gEvAzcq+Z7zkEoJOIaYx4imi6MqcB7WNR5AeYkYkbtu+HO2s2bNuSiXaQtoBjgSfgd/Vxi1BOwvBi0zQb8+yK2uu/zceY7PTgRcMrZ6RGj/2M8rHdcP7aJYCuZ3iLwCby4LrKvvhAAAAAElFTkSuQmCC');
  background-repeat: no-repeat;
  background-position: 7px 0;
}

/* Form table in tabs */
.new-settings-source-tab #tabs .form-table th {
    padding: 15px 10px 15px 0;
    width: 200px;
    vertical-align: top;
}

.new-settings-source-tab #tabs .form-table td {
    padding: 15px 10px;
}

/* Alert boxes compatibility */
.new-settings-source-tab .alert,
.new-automatic-sources-tab .alert {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-radius: var(--asi-border-radius);
    margin-bottom: 20px;
    background: var(--asi-gray-100);
}

.new-settings-source-tab .alert-icon,
.new-automatic-sources-tab .alert-icon {
    margin-right: 15px;
    flex-shrink: 0;
}

.new-settings-source-tab .alert-text,
.new-automatic-sources-tab .alert-text {
    flex: 1;
}

/* Update nag in bank settings */
.new-settings-source-tab .update-nag {
    background: var(--asi-warning-light);
    border-left: 4px solid var(--asi-warning);
    padding: 12px 15px;
    margin: 10px 0;
}

/* Checkbox list */
.new-settings-source-tab .checkbox-list,
.new-automatic-sources-tab .checkbox-list {
    display: flex;
    flex-direction: column;
}

.new-settings-source-tab .checkbox-list .checkbox,
.new-automatic-sources-tab .checkbox-list .checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.new-settings-source-tab .checkbox-list .checkbox input,
.new-automatic-sources-tab .checkbox-list .checkbox input {
    margin-right: 8px;
}

.new-settings-source-tab .checkbox-disabled,
.new-automatic-sources-tab .checkbox-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Radio list */
.new-settings-source-tab .radio-list,
.new-automatic-sources-tab .radio-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.new-settings-source-tab .radio-list li,
.new-automatic-sources-tab .radio-list li {
    margin-bottom: 5px;
}

/* Buttons in bank settings */
.new-settings-source-tab .btn,
.new-automatic-sources-tab .btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.new-settings-source-tab .btn-primary,
.new-automatic-sources-tab .btn-primary {
    background: var(--asi-primary);
    color: #fff;
}

.new-settings-source-tab .btn-primary:hover,
.new-automatic-sources-tab .btn-primary:hover {
    background: #2684FF;
}

/* Form controls */
.new-settings-source-tab .form-control,
.new-automatic-sources-tab .form-control {
    border: 1px solid var(--asi-gray-300);
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 300px;
}

.new-settings-source-tab .form-control:focus,
.new-automatic-sources-tab .form-control:focus {
    border-color: var(--asi-primary);
    box-shadow: 0 0 0 3px var(--asi-primary-light);
    outline: none;
}

/* H5 styling */
.new-settings-source-tab h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--asi-dark);
    margin: 0 0 5px;
}

/* ==========================================================================
   Plugin Status Badges
   ========================================================================== */
.allsi-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

.allsi-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.allsi-badge-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.allsi-badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.allsi-badge-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.allsi-badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
