/* SEO Booster Settings Page Styles */

/* Main container to prevent layout issues */
.seo-booster-settings-page {
    overflow: hidden;
    clear: both;
    min-height: 100vh;
}

/* Ensure form is properly contained */
#seobooster_settings {
    position: relative;
    z-index: 1;
}

/* Import section specific styling */
.sb-import-section {
    position: relative;
    z-index: 1;
    clear: both;
    overflow: hidden;
}

/* Tab content containers */
.sb-tab-content {
    position: relative;
    z-index: 1;
    clear: both;
}

/* Tab Navigation Styles */
.sb-seo-tabs {
    margin: 20px 0 0 0;
}

.sb-seo-tabs .nav-tab-wrapper {
    border-bottom: 1px solid #ccd0d4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.sb-seo-tabs .nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    float: none;
    box-sizing: border-box;
    padding: 8px 12px;
    margin: 0;
    border: 1px solid #ccd0d4;
    border-bottom: none;
    border-left: 0;
    background: #f6f7f7;
    color: #50575e;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    font-size: 13px;
    line-height: 1.5;
    font-weight: normal;
}

.sb-seo-tabs .nav-tab:first-child {
    border-left: 1px solid #ccd0d4;
}

.sb-seo-tabs .nav-tab.nav-tab-active:first-child {
    border-left: 1px solid #ccd0d4;
}

.sb-seo-tabs .nav-tab:hover {
    background: #f0f0f1;
    color: #2271b1;
}

.sb-seo-tabs .nav-tab.nav-tab-active {
    background: #fff;
    color: #2271b1;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.sb-seo-tabs .nav-tab:focus,
.sb-seo-tabs .nav-tab:focus-visible,
.sb-seo-tabs .nav-tab.nav-tab-active:focus {
    outline: none;
    box-shadow: none;
}

.sb-seo-tabs .nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Open Graph Enhanced Fields Styles */
#organization-fields,
#person-fields,
#organization-identifiers,
#social-profiles {
    transition: opacity 0.3s ease;
}

#organization-fields h3,
#person-fields h3,
#organization-identifiers h3,
#social-profiles h3 {
    margin: 20px 0 10px 0;
    padding: 10px 0;
    border-bottom: 1px solid #e1e1e1;
    color: #23282d;
    font-size: 16px;
}

.social-profile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.social-profile-row input[type="url"] {
    flex: 1;
    margin: 0;
}

.remove-social-profile {
    background: #dc3232;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-social-profile:hover {
    background: #a00;
}

#add-social-profile {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

#add-social-profile:hover {
    background: #005a87;
}

/* Form field improvements */
.form-table th[colspan="2"] h3 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 16px;
    font-weight: 600;
}

.form-table th[colspan="2"] .description {
    margin: 5px 0 0 0;
    font-style: italic;
    color: #666;
}

/* Tab Content Styles */
.sb-tab-content {
    display: none;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    padding: 20px;
    margin-top: -1px;
}

.sb-tab-content.sb-tab-active {
    display: block;
}

/* Automatic Links settings */
.sb-autolink-settings .sb-settings-section-row th {
    padding-top: 24px;
}

.sb-autolink-settings .sb-settings-section-title {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.sb-excluded-elements {
    max-width: 640px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #f6f7f7;
    padding: 12px 16px;
}

.sb-excluded-elements__group {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}

.sb-excluded-elements__group:last-of-type {
    margin-bottom: 0;
}

.sb-excluded-elements__group legend {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #646970;
}

.sb-excluded-elements__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
}

.sb-excluded-elements__item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.4;
}

.sb-excluded-elements__item:hover {
    border-color: #2271b1;
}

.sb-excluded-elements__item input {
    margin: 0;
    flex-shrink: 0;
}

.sb-excluded-elements__item span {
    font-size: 13px;
}

.sb-excluded-elements__locked {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dcdcde;
}

.sb-excluded-elements__locked-title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #646970;
}

.sb-excluded-elements__locked-title .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.sb-excluded-elements__locked-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sb-excluded-elements__locked-list li {
    margin: 0;
    padding: 6px 10px;
    background: #fff;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    color: #646970;
    font-size: 13px;
}

@media screen and (max-width: 782px) {
    .sb-excluded-elements__grid,
    .sb-excluded-elements__locked-list {
        grid-template-columns: 1fr;
    }
}

/* Image Upload Styles */
.sb-seo-image-upload {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.sb-seo-image-upload input {
    flex: 1;
}

.sb-seo-image-preview img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Separator Options */
.sb-seo-separator-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.sb-seo-separator-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
}

.sb-seo-separator-option:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.sb-seo-separator-option input[type="radio"] {
    margin: 0 8px 0 0;
}

.sb-seo-separator-preview {
    font-size: 18px;
    font-weight: bold;
    color: #2271b1;
}

/* Field with Inserter */
.sb-seo-field-with-inserter {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.sb-seo-field-with-inserter input,
.sb-seo-field-with-inserter textarea {
    flex: 1;
}

.sb-variable-inserter-btn {
    white-space: nowrap;
    margin-top: 0;
}

/* Variable Dropdown */
.sb-variable-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
}

.sb-variable-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.sb-variable-option:hover {
    background: #f5f5f5;
}

.sb-variable-option:last-child {
    border-bottom: none;
}

.sb-variable-option code {
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 11px;
}

/* Save Section */
.sb-seo-save-section {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* SEO Plugin Warning */
.sb-seo-plugin-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 20px 0;
    color: #856404;
}

.sb-seo-plugin-warning strong {
    color: #d63031;
}

/* Content Types Collapsible Styles */
.sb-content-types-section {
    margin: 20px 0;
}

.sb-content-types-section h3 {
    margin: 20px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #23282d;
}

.sb-content-type-item {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.sb-content-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sb-content-type-header:hover {
    background: #f0f0f0;
}

.sb-content-type-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sb-content-type-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
}

.sb-content-type-status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sb-content-type-status.index {
    background: #d4edda;
    color: #155724;
}

.sb-content-type-status.noindex {
    background: #f8d7da;
    color: #721c24;
}

.sb-content-type-toggle {
    font-size: 16px;
    color: #666;
    transition: transform 0.2s ease;
}

.sb-content-type-header.active .sb-content-type-toggle {
    transform: rotate(180deg);
}

.sb-content-type-content {
    display: none;
    padding: 20px;
    border-top: 1px solid #ddd;
}

.sb-content-type-content.active {
    display: block;
}

/* Import Section Styles */
.sb-import-section {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.sb-import-section p {
    margin: 0 0 15px 0;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005177);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* GSC Import Actions Styles */
.sb-gsc-import-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sb-gsc-time-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sb-gsc-time-range label {
    font-weight: 600;
    color: #23282d;
}

.sb-gsc-time-range select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.sb-gsc-buttons {
    display: flex;
    gap: 10px;
}

/* Status Indicators */
.status-pending {
    color: #f0ad4e;
    font-weight: 600;
}

.status-in-progress {
    color: #5bc0de;
    font-weight: 600;
}

.status-complete {
    color: #5cb85c;
    font-weight: 600;
}

.status-failed {
    color: #d9534f;
    font-weight: 600;
}

.status-canceled {
    color: #777;
    font-weight: 600;
}

/* WordPress Table Enhancements */
#stats-tab .wp-list-table .column-hook code,
#stats-tab .wp-list-table .column-table-name code,
#stats-tab .wp-list-table .column-value code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

#stats-tab .wp-list-table .column-status span,
#stats-tab .wp-list-table .column-value.column-status span {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

#stats-tab .sb-stats-section {
    margin-bottom: 30px;
}

#stats-tab .sb-stats-section:last-child {
    margin-bottom: 0;
}

#stats-tab .sb-stats-section > h2 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #1d2327;
}

#stats-tab .sb-stats-section > .description {
    margin: 0 0 12px;
}

#stats-tab .sb-stats-table-wrap {
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    background: #fff;
    overflow: hidden;
}

#stats-tab .sb-stats-table-wrap .wp-list-table {
    border: 0;
    margin: 0;
}

#stats-tab .sb-stats-table thead th {
    font-weight: 600;
}

#stats-tab .sb-stats-total-row td {
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
}

#stats-tab .sb-cache-actions {
    margin-top: 15px;
}

#stats-tab .sb-cache-actions .button .dashicons {
    line-height: 1.4;
    margin-right: 4px;
}

/* Legacy selectors for tables outside stats tab */
.wp-list-table .column-hook code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.wp-list-table .column-status span {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-neutral {
    background: #e2e3e5;
    color: #383d41;
}

/* Toggle Switch Styles */
.sb-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.sb-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sb-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.sb-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.sb-toggle-switch input:checked + .sb-toggle-slider {
    background-color: #2196F3;
}

.sb-toggle-switch input:checked + .sb-toggle-slider:before {
    transform: translateX(26px);
}

.sb-toggle-switch:hover .sb-toggle-slider {
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
}

.sb-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
}

.sb-toggle-label:hover {
    color: #2271b1;
}

.sb-toggle-group .sb-toggle-label:last-child {
    margin-bottom: 0;
}

.sb-toggle-bot-list .sb-toggle-label {
    margin-bottom: 8px;
}

.sb-bot-visited-only-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    font-size: 13px;
}

.sb-bot-block-stats-caption {
    margin: 4px 0 0;
}

.sb-toggle-bot-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #c3c4c7;
    padding: 0;
    background: #fff;
}

.sb-bot-block-header,
.sb-bot-block-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 72px 110px;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    margin: 0;
}

.sb-bot-block-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #646970;
}

.sb-bot-block-rows .sb-bot-block-row {
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f1;
}

.sb-bot-block-rows .sb-bot-block-row:last-child {
    border-bottom: none;
}

.sb-bot-block-col-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-bot-block-col-visits,
.sb-bot-block-col-last {
    font-size: 12px;
    color: #646970;
    text-align: right;
    white-space: nowrap;
}

.sb-bot-block-row.is-filtered-out {
    display: none;
}

/* Cache Management Styles */
.sb-cache-stats {
    margin: 0;
}

.sb-cache-stats table {
    margin-bottom: 0;
}

.sb-cache-actions {
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.sb-cache-actions button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sb-cache-actions button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sb-seo-tabs .nav-tab {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .sb-seo-image-upload {
        flex-direction: column;
    }
}
