/* WRO Settings Page Styles - Optimized */

.kdsamref-settings-modern {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tab Navigation Styles */
.kdsamref-settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.kdsamref-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #495057;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 28px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
    outline: none;
    flex: 1;
    text-align: center;
    min-width: 0;
}

.kdsamref-tab-btn:hover {
    background: #f8f9fa;
    color: #007cba;
}

.kdsamref-tab-btn.active {
    border-bottom: 2px solid #007cba;
    color: #007cba;
    background: #f8f9fa;
    font-weight: 600;
}

.kdsamref-tab-content {
    display: none;
    padding: 24px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.kdsamref-tab-content:first-of-type {
    display: block !important;
}

/* Responsive tab design */
@media (max-width: 768px) {
    .kdsamref-settings-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .kdsamref-tab-btn {
        border-bottom: 1px solid #e9ecef;
        border-right: none;
        padding: 16px 20px;
        text-align: left;
    }
    
    .kdsamref-tab-btn.active {
        border-bottom: 2px solid #007cba;
        background: #f8f9fa;
    }
    
    .kdsamref-tab-content {
        border: 1px solid #e9ecef;
        border-radius: 0 0 8px 8px;
        margin-top: -1px;
    }
}

.kdsamref-settings-header {
    /* background: #fff; */
    /* border: 1px solid #ddd; */
    /* border-radius: 8px; */
    padding: 24px;
    margin-bottom: 24px;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    text-align: center;
}

.kdsamref-header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.kdsamref-settings-title {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.kdsamref-settings-subtitle {
    margin: 0;
    color: #646970;
    font-size: 14px;
}

.kdsamref-header-actions {
    display: flex;
    gap: 12px;
}

.kdsamref-settings-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kdsamref-settings-form {
    padding: 0;
}

.kdsamref-settings-section {
    border-bottom: 1px solid #f0f0f1;
}

.kdsamref-settings-section:last-child {
    border-bottom: none;
}

.kdsamref-section-header {
    background: #f8f9fa;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f1;
}

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

.kdsamref-section-description {
    color: #646970;
    font-size: 13px;
}

.kdsamref-section-content {
    padding: 24px;
}

.kdsamref-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.kdsamref-setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kdsamref-setting-group label {
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.kdsamref-setting-group input[type="text"],
.kdsamref-setting-group input[type="number"],
.kdsamref-setting-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 200px;
}

.kdsamref-setting-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.kdsamref-setting-hint {
    color: #646970;
    font-size: 12px;
}

.kdsamref-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kdsamref-checkbox-group input[type="checkbox"] {
    margin: 0;
}

.kdsamref-checkbox-group label {
    margin: 0;
    font-weight: normal;
}

.kdsamref-range-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kdsamref-range-container input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.kdsamref-range-container span {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
}

.kdsamref-settings-actions {
    padding: 24px;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f1;
    text-align: right;
}

/* License Details Styling */
.kdsamref-license-details {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.kdsamref-license-detail {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.kdsamref-license-detail:last-child {
    border-bottom: none;
}

.kdsamref-license-detail strong {
    color: #1d2327;
    font-weight: 600;
    min-width: 120px;
}

.kdsamref-license-detail > *:not(strong) {
    flex: 1;
    text-align: right;
}

.kdsamref-license-detail code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #1d2327;
}

.kdsamref-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kdsamref-status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.kdsamref-status-suspended {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.kdsamref-status-expired {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.kdsamref-status-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.kdsamref-license-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kdsamref-license-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kdsamref-license-actions .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Premium Features Styling */
.kdsamref-premium-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.kdsamref-feature-badge {
    background: #e0f2fe;
    color: #0277bd;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #b3e5fc;
}

/* License Limits Styling */
.kdsamref-license-limits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.kdsamref-limit-item {
    font-size: 12px;
    color: #666;
    padding: 2px 0;
}

.kdsamref-limit-item:before {
    content: "• ";
    color: #007cba;
    font-weight: bold;
}

/* Customer Information Styling */
.kdsamref-customer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.kdsamref-customer-name {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.kdsamref-customer-company {
    color: #646970;
    font-size: 12px;
    font-style: italic;
}

.kdsamref-customer-email,
.kdsamref-customer-phone {
    font-size: 12px;
}

.kdsamref-customer-email a,
.kdsamref-customer-phone a {
    color: #007cba;
    text-decoration: none;
}

.kdsamref-customer-email a:hover,
.kdsamref-customer-phone a:hover {
    text-decoration: underline;
}

.kdsamref-customer-id {
    font-size: 11px;
    color: #8c8f94;
    font-style: italic;
}

/* Customer Address Styling */
.kdsamref-customer-address {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    font-size: 12px;
    color: #646970;
}

.kdsamref-customer-address div {
    line-height: 1.3;
}

/* Product Information Styling */
.kdsamref-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.kdsamref-product-name {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.kdsamref-product-version,
.kdsamref-license-version {
    font-size: 11px;
    color: #646970;
}

/* Spinning icon for refresh button - Optimized */
.dashicons-update-spin {
    animation: spin 1s linear infinite;
    will-change: transform;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button with icon styling */
.button .dashicons {
    vertical-align: middle;
    margin-right: 4px;
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Export/Import button styling */
.kdsamref-setting-group .button .dashicons {
    margin-right: 6px;
}

/* Settings file input styling */
#kdsamref-import-settings {
    width: 100%;
    max-width: 300px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* Export/Import specific buttons */
#kdsamref-export-settings,
#kdsamref-import-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

/* Reset button styling */
#kdsamref-reset-settings {
    color: #b32d2e;
    border-color: #b32d2e;
}

#kdsamref-reset-settings:hover {
    background: #b32d2e;
    color: white;
    border-color: #a02622;
}



/* Better notification styling */
.notice.is-dismissible {
    position: relative;
    padding-right: 38px;
}

.notice.is-dismissible .notice-dismiss {
    position: absolute;
    top: 0;
    right: 1px;
    border: none;
    margin: 0;
    padding: 9px;
    background: none;
    color: #787c82;
    cursor: pointer;
}

.notice.is-dismissible .notice-dismiss:hover {
    color: #d63638;
}

.notice.is-dismissible .notice-dismiss:before {
    background: none;
    color: currentColor;
    content: "\f153";
    display: block;
    font: normal 16px/20px dashicons;
    speak: never;
    height: 20px;
    text-align: center;
    width: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Compatibility Manager Styles */
.kdsamref-compatibility-status {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.kdsamref-mode-current,
.kdsamref-orderable-detection {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kdsamref-mode-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kdsamref-mode-auto {
    background: #e0f2fe;
    color: #0277bd;
    border: 1px solid #b3e5fc;
}

.kdsamref-mode-orderable {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.kdsamref-mode-woocommerce {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

.kdsamref-detection-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.kdsamref-detection-badge.detected {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.kdsamref-detection-badge.not-detected {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.kdsamref-setting-description {
    margin-top: 8px;
}

.kdsamref-mode-descriptions {
    margin-top: 12px;
}

.kdsamref-mode-desc {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
}

.kdsamref-mode-desc strong {
    color: #1d2327;
    display: block;
    margin-bottom: 4px;
}

.kdsamref-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.kdsamref-feature-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}

.kdsamref-compatibility-warning {
    margin: 16px 0;
    padding: 0;
    border: 1px solid #ffb02e;
    border-radius: 6px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    overflow: hidden;
}

.kdsamref-warning-content {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.kdsamref-warning-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.kdsamref-warning-text {
    flex: 1;
}

.kdsamref-warning-text strong {
    color: #e65100;
    display: block;
    margin-bottom: 4px;
}

.kdsamref-warning-text p {
    margin: 0 0 8px 0;
    color: #bf360c;
    font-size: 13px;
}

.kdsamref-warning-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.kdsamref-warning-note {
    font-size: 12px;
    color: #bf360c;
    font-style: italic;
}

.kdsamref-compatibility-info {
    margin-top: 20px;
}

.kdsamref-compatibility-info h4 {
    margin: 16px 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.kdsamref-status-list,
.kdsamref-forbidden-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kdsamref-status-item {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.kdsamref-forbidden-item {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Mode Selection Interactivity */
#kdsamref_compatibility_mode {
    max-width: 250px;
}

/* Add smooth transitions */
.kdsamref-mode-badge,
.kdsamref-detection-badge,
.kdsamref-status-item,
.kdsamref-forbidden-item,
.kdsamref-feature-item {
    transition: all 0.2s ease;
}

.kdsamref-compatibility-warning {
    animation: slideInWarning 0.3s ease-out;
}

@keyframes slideInWarning {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive compatibility section */
@media (max-width: 768px) {
    .kdsamref-compatibility-status {
        flex-direction: column;
        gap: 12px;
    }
    
    .kdsamref-features-list {
        flex-direction: column;
    }
    
    .kdsamref-warning-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .kdsamref-warning-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
@media (max-width: 768px) {
    .kdsamref-header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .kdsamref-settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .kdsamref-setting-group input[type="text"],
    .kdsamref-setting-group input[type="number"],
    .kdsamref-setting-group select {
        max-width: 100%;
    }
    
    .kdsamref-license-actions {
        flex-direction: column;
    }
}

/* Status Order & Colors Styles */
.kdsamref-status-order-config {
    margin-top: 20px;
}

.kdsamref-status-order-list {
    margin: 15px 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.kdsamref-status-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f8f9fa;
    background: white;
    transition: background-color 0.2s;
}

.kdsamref-status-order-item:last-child {
    border-bottom: none;
}

.kdsamref-status-order-item:hover {
    background: #f8f9fa;
}

.kdsamref-status-order-handle {
    cursor: move;
    color: #6c757d;
    font-size: 16px;
    user-select: none;
    padding: 4px;
}

.kdsamref-status-order-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kdsamref-status-label-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
}

.kdsamref-status-slug {
    font-size: 11px;
    color: #6c757d;
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.kdsamref-status-color-input {
    width: 40px;
    height: 40px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
}

.kdsamref-status-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.kdsamref-status-remove-btn:hover {
    background: #c82333;
}

.kdsamref-status-add-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.kdsamref-status-add-section select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.kdsamref-status-add-section button {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.kdsamref-status-add-section button:hover {
    background: #005a87;
}

/* Color Settings Styles */
.kdsamref-color-settings {
    margin-top: 20px;
}

.kdsamref-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.kdsamref-color-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.kdsamref-color-item label {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.kdsamref-color-item input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
}

/* Sortable Styles */
.sortable-ghost {
    opacity: 0.5;
    background: #e3f2fd !important;
}

.sortable-chosen {
    background: #f3e5f5 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Custom Status Management Styles */
.kdsamref-custom-status-management {
    margin-top: 20px;
}

.kdsamref-add-custom-status {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.kdsamref-add-custom-status h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.kdsamref-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.kdsamref-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kdsamref-form-group label {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.kdsamref-form-group input[type="text"],
.kdsamref-form-group input[type="color"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.kdsamref-form-group input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.kdsamref-custom-statuses-list {
    margin-top: 20px;
}

.kdsamref-custom-statuses-list h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.kdsamref-no-custom-statuses {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    margin: 10px 0;
}

/* Workflow Definition Styles */
.kdsamref-workflow-definition {
    margin-top: 20px;
}

.kdsamref-workflow-steps {
    margin: 15px 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    padding: 15px;
}

.kdsamref-workflow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f8f9fa;
    background: white;
    transition: background-color 0.2s;
}

.kdsamref-workflow-step:last-child {
    border-bottom: none;
}

.kdsamref-workflow-step:hover {
    background: #f8f9fa;
}

.kdsamref-step-number {
    width: 30px;
    height: 30px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.kdsamref-step-content {
    flex: 1;
}

.kdsamref-step-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.kdsamref-step-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.kdsamref-step-remove-btn:hover:not(:disabled) {
    background: #c82333;
}

.kdsamref-step-remove-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.kdsamref-workflow-actions {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.kdsamref-workflow-actions button {
    margin-right: 10px;
}

/* Arrow indicators between steps */
.kdsamref-workflow-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
}

.kdsamref-workflow-step {
    position: relative;
}
