.discountkit-admin {
    margin-top: 20px;
}

#discountkit-admin-root{
    font-family: "Nunito", sans-serif;
}

/* Page Header with Gradient */
.discountkit-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 40px;
    margin: 0 0 30px 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.discountkit-page-header h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.discountkit-header-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
    backdrop-filter: blur(10px);
}

.discountkit-header-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Modern Tab Navigation */
.discountkit-app {
    margin-top: 20px;
}

.discountkit-tab-nav {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e1e5e9;
}

.discountkit-tab-button {
    background: transparent;
    border: none;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    position: relative;
    margin-right: 4px;
     text-transform: uppercase;
}

.discountkit-tab-button:hover {
    color: #1d2327;
    background: rgba(86, 45, 212, 0.05);
}

.discountkit-tab-button.active {
    color: #562dd4;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.discountkit-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #562dd4;
}

.discountkit-tab-content {
    background: #fff;
    padding: 32px;
    border-radius: 0 0 8px 8px;
    min-height: 500px;
}

/* Modern Settings Styles */
.discountkit-settings-container {
    max-width: 1200px;
    margin: 0 auto;
}

.discountkit-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.discountkit-settings-container .discountkit-form-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.discountkit-settings-container .discountkit-form-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.discountkit-settings-container .discountkit-form-section h3 {
    margin: 0 0 20px 0;
    color: #1d2327;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f3f4;
}

.discountkit-settings-container .discountkit-form-section h3 .dashicons {
    margin-right: 12px;
    color: #562dd4;
    font-size: 20px;
    background: rgba(86, 45, 212, 0.1);
    padding: 8px;
    border-radius: 8px;
}

.discountkit-settings-container .discountkit-form-actions {
    background: #fff;
    padding: 24px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}

.discountkit-settings-container .discountkit-form-actions .components-button {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.discountkit-header .components-button {
    margin-left: 10px;
    border-radius: 5px;
}

.discountkit-settings-container .discountkit-form-actions .components-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 45, 212, 0.3);
}

/* Select Wrapper Styles */
.discountkit-select-wrapper {
    margin-bottom: 24px;
    position: relative;
}

.discountkit-select-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.discountkit-select-wrapper select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M6 8L0 2h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

.discountkit-select-wrapper select:focus {
    border-color: #562dd4;
    box-shadow: 0 0 0 3px rgba(86, 45, 212, 0.1), 0 2px 8px rgba(0,0,0,0.15);
    outline: none;
    transform: translateY(-1px);
}

.discountkit-select-wrapper select:hover {
    border-color: #a7aaad;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Modern Dropdown Options */
.discountkit-select-wrapper select option {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
    background: #fff;
    border: none;
    transition: all 0.2s ease;
}

.discountkit-select-wrapper select option:hover {
    background: #f8f9fa;
    color: #562dd4;
}

.discountkit-select-wrapper select option:checked {
    background: #562dd4;
    color: #fff;
    font-weight: 600;
}

.discountkit-select-wrapper select option:disabled {
    color: #8c8f94;
    background: #f6f7f7;
    cursor: not-allowed;
}

/* Toggle Switch Styles */
.discountkit-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.discountkit-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.discountkit-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.discountkit-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccd0d4;
    border-radius: 24px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.discountkit-toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.discountkit-toggle-switch input:checked + .discountkit-toggle-slider {
    background-color: #562dd4;
}

.discountkit-toggle-switch input:checked + .discountkit-toggle-slider:before {
    transform: translateX(20px);
}

.discountkit-toggle-switch:hover .discountkit-toggle-slider {
    box-shadow: 0 0 0 2px rgba(86, 45, 212, 0.2);
}

.discountkit-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    min-width: 60px;
}

.discountkit-toggle-switch input:checked ~ .discountkit-toggle-label {
    color: #562dd4;
}

.discountkit-toggle-switch input:not(:checked) ~ .discountkit-toggle-label {
    color: #8c8f94;
}

/* Form Toggle Styles */
.discountkit-form-toggle {
    margin-bottom: 20px;
}

.discountkit-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.discountkit-form-toggle .discountkit-toggle-container {
    margin-top: 4px;
}

.discountkit-form-toggle .discountkit-toggle-switch {
    padding: 8px 0;
}

/* Rules Styles */
.discountkit-container {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.discountkit-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.discountkit-empty {
    text-align: center;
    padding: 40px;
    color: #646970;
}

.discountkit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.discountkit-rule-card {
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.discountkit-rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.discountkit-rule-header h3 {
    margin: 0;
    font-size: 16px;
}

.discountkit-description {
    font-size: 13px;
    color: #646970;
    margin: 8px 0;
}

.discountkit-rule-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* Form Field Styles */
.discountkit-form-field {
    margin-bottom: 20px;
}

.discountkit-form-field label,
.discountkit-conditions-grid label,
.discountkit-advanced-grid label,
.discountkit-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    text-transform: capitalize;
}

/* Override ALL label styles with maximum specificity */
#discountkit-admin-root .discountkit-form-container label,
#discountkit-admin-root .discountkit-form-section label,
#discountkit-admin-root .discountkit-form-field label,
#discountkit-admin-root .discountkit-conditions-grid label,
#discountkit-admin-root .discountkit-advanced-grid label,
#discountkit-admin-root .discountkit-form-field .components-text-control__label,
#discountkit-admin-root .discountkit-form-field .components-select-control__label,
#discountkit-admin-root .discountkit-conditions-grid .components-text-control__label,
#discountkit-admin-root .discountkit-advanced-grid .components-text-control__label,
#discountkit-admin-root .discountkit-product-selector label,
#discountkit-admin-root .components-base-control__label {
    font-family: "Nunito", sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
    color: #1d2327 !important;
    display: block !important;
}

/* Unified Form Field Styles */
.discountkit-form-field select,
.discountkit-form-field input[type="text"],
.discountkit-form-field input[type="number"],
.discountkit-conditions-grid select,
.discountkit-conditions-grid input,
.discountkit-advanced-grid input,
.discountkit-product-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}

.discountkit-form-field select:focus,
.discountkit-form-field input:focus,
.discountkit-conditions-grid select:focus,
.discountkit-conditions-grid input:focus,
.discountkit-advanced-grid input:focus,
.discountkit-product-search:focus {
    border-color: #562dd4;
    outline: none;
    box-shadow: 0 0 0 1px #562dd4;
}

.discountkit-form-field select,
.discountkit-conditions-grid select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M6 8L0 2h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Simple Form Field Select Options */
.discountkit-form-field select option,
.discountkit-conditions-grid select option {
    padding: 8px 12px;
    font-size: 14px;
    color: #1d2327;
    background: #fff;
}

/* Form Container and Sections */
.discountkit-form-container {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.discountkit-form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.discountkit-form-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #dcdcde;
    color: #1d2327;
}

.discountkit-conditions-grid,
.discountkit-advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.discountkit-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
}

.discountkit-loading {
    text-align: center;
    padding: 60px;
    font-size: 16px;
    color: #646970;
}

/* Modern Settings Loader */
.discountkit-settings-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.discountkit-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: dmwooSpin 1s linear infinite;
}

@keyframes dmwooSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Selector Styles */
.discountkit-product-selector {
    margin-top: 15px;
}

.discountkit-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-top: 5px;
    background: #fff;
}

.discountkit-search-result {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discountkit-search-result:hover {
    background: #f6f7f7;
}

.discountkit-search-result:last-child {
    border-bottom: none;
}

.discountkit-search-result .product-name {
    font-weight: 500;
    color: #1d2327;
}

.discountkit-search-result .product-price {
    font-size: 12px;
    color: #646970;
}

.discountkit-selected-products {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.discountkit-selected-products h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #1d2327;
}

.discountkit-selected-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    margin-bottom: 5px;
}

.discountkit-selected-product:last-child {
    margin-bottom: 0;
}

.discountkit-selected-product .product-name {
    font-size: 13px;
    color: #1d2327;
}

.discountkit-remove-product {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discountkit-remove-product:hover {
    background: #a00;
}

/* Filter Instructions */
.discountkit-filter-instruction {
    font-size: 12px;
    color: #646970;
    margin: 5px 0 0 0;
    font-style: italic;
    padding: 8px 12px;
    background: #f0f6fc;
    border-left: 3px solid #562dd4;
    border-radius: 0 4px 4px 0;
}

.discountkit-filter-instruction.exclude {
    background: #fef7f0;
    border-left-color: #d63638;
    color: #8a2424;
}

/* Toast Notification Styles */
.discountkit-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    min-width: 280px;
    max-width: 400px;
    padding: 10px 36px 10px 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: dmwooSlideIn 0.3s ease-out;
}

@keyframes dmwooSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.discountkit-toast-success {
    border-left: 4px solid #00a32a;
}

.discountkit-toast-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #00a32a;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.discountkit-toast-error {
    border-left: 4px solid #d63638;
}

.discountkit-toast-error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #d63638;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.discountkit-toast-message {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    line-height: 1.3;
}

.discountkit-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #8c8f94;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.discountkit-toast-close:hover {
    background: #f0f0f1;
    color: #1d2327;
}

/* Field Help Text */
.discountkit-field-help {
    font-size: 12px;
    color: #646970;
    margin: 6px 0 0 0;
    line-height: 1.5;
    font-style: italic;
}

/* Bulk Discount Ranges */
.discountkit-bulk-ranges {
    margin-top: 15px;
}

.discountkit-bulk-range-header {
    display: grid;
    grid-template-columns: 150px 1fr 1fr 100px 120px 40px;
    gap: 10px;
    padding: 10px 15px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
}

.discountkit-bulk-range-row {
    margin-bottom: 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dcdcde;
    border-top: none;
}

.discountkit-bulk-range-row:last-of-type {
    border-radius: 0 0 4px 4px;
}

.discountkit-bulk-range-fields {
    display: grid;
    grid-template-columns: 150px 1fr 1fr 100px 120px 40px;
    gap: 10px;
    align-items: end;
}

.discountkit-bulk-range-fields .discountkit-form-field {
    margin-bottom: 0;
}

.discountkit-bulk-range-fields .discountkit-form-field label {
    display: none;
}

.discountkit-remove-range {
    background: #dc3232;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.discountkit-remove-range:hover:not(:disabled) {
    background: #a00;
}

.discountkit-remove-range:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Delete Modal Styles */
.discountkit-delete-modal .components-modal__content {
    padding: 24px;
}

.discountkit-delete-modal p {
    font-size: 14px;
    color: #646970;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.discountkit-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.discountkit-modal-actions .components-button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .discountkit-toast {
        top: 16px;
        right: 16px;
        left: 16px;
        min-width: auto;
    }
    
    .discountkit-settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .discountkit-tab-content {
        padding: 20px;
    }
    
    .discountkit-settings-container .discountkit-form-section {
        padding: 20px;
    }
    
    .discountkit-conditions-grid,
    .discountkit-advanced-grid {
        grid-template-columns: 1fr;
    }
    
    .discountkit-bulk-range-fields {
        grid-template-columns: 1fr;
    }
}