/**
 * Botanical Teas Smart Discounts - Admin Styles
 *
 * Tea Room aesthetic: natural greens, warm creams, clean typography.
 */

/* ── Layout ─────────────────────────────────────────────── */

.bt-discounts-wrap {
    max-width: 1200px;
}

.bt-discounts-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 16px;
}

.bt-discounts-main {
    flex: 1;
    min-width: 0;
}

.bt-discounts-sidebar {
    flex: 0 0 280px;
}

@media (max-width: 960px) {
    .bt-discounts-layout {
        flex-direction: column;
    }
    .bt-discounts-sidebar {
        flex: none;
        width: 100%;
    }
}

/* ── Header ─────────────────────────────────────────────── */

.bt-discounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bt-discounts-header h2 {
    margin: 0;
    font-size: 18px;
    color: #2a3a1e;
}

/* ── Notices ────────────────────────────────────────────── */

.bt-discounts-notices .notice {
    margin: 8px 0;
}

.bt-notice {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

.bt-notice-success {
    background: #f0f5ec;
    border-left: 4px solid #6b8e23;
    color: #2a3a1e;
}

.bt-notice-error {
    background: #fdf0ef;
    border-left: 4px solid #c0392b;
    color: #5a1a1a;
}

/* ── Rules Table ────────────────────────────────────────── */

#bt-rules-table {
    border: 1px solid #d5dcc9;
    border-radius: 6px;
    overflow: hidden;
}

#bt-rules-table thead th {
    background: #f5f8f0;
    border-bottom: 2px solid #c5d9b2;
    color: #3d4f2f;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
}

#bt-rules-table tbody tr {
    border-bottom: 1px solid #e8eee1;
}

#bt-rules-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: 13px;
}

#bt-rules-table .bt-no-rules td {
    text-align: center;
    color: #888;
    padding: 32px 12px;
    font-style: italic;
}

.bt-rule-disabled {
    opacity: 0.55;
}

.bt-col-status {
    width: 50px;
    text-align: center;
}

.bt-col-priority {
    width: 70px;
    text-align: center;
}

.bt-col-actions {
    width: 140px;
    white-space: nowrap;
}

.bt-col-actions .button {
    margin-right: 4px;
}

/* ── Status Toggle ──────────────────────────────────────── */

.bt-toggle-rule {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.bt-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.bt-status-active {
    background-color: #6b8e23;
    box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.25);
}

.bt-status-inactive {
    background-color: #bbb;
    box-shadow: 0 0 0 2px rgba(187, 187, 187, 0.25);
}

/* ── Type Badge ─────────────────────────────────────────── */

.bt-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #fff;
}

.bt-type-cart_threshold {
    background: #6b8e23;
}

.bt-type-bogo {
    background: #b8860b;
}

.bt-type-bulk_pricing {
    background: #4a7c59;
}

.bt-type-double_points {
    background: #7b6b8a;
}

/* ── Settings Sidebar ───────────────────────────────────── */

.bt-settings-box {
    background: #fff;
    border: 1px solid #d5dcc9;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.bt-settings-box h3 {
    margin: 0 0 14px;
    font-size: 15px;
    color: #2a3a1e;
    border-bottom: 1px solid #e8eee1;
    padding-bottom: 10px;
}

.bt-info-box dl {
    margin: 0;
}

.bt-info-box dt {
    font-weight: 600;
    color: #3d4f2f;
    margin-top: 10px;
    font-size: 13px;
}

.bt-info-box dt:first-child {
    margin-top: 0;
}

.bt-info-box dd {
    margin: 2px 0 0 0;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

/* ── Form Fields ────────────────────────────────────────── */

.bt-field {
    margin-bottom: 14px;
}

.bt-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #3d4f2f;
}

.bt-field label .required {
    color: #c0392b;
}

.bt-field input[type="text"],
.bt-field input[type="number"],
.bt-field select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c5d9b2;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.bt-field input:focus,
.bt-field select:focus {
    border-color: #6b8e23;
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.15);
}

.bt-field .description {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.bt-radio,
.bt-checkbox {
    display: block;
    font-weight: normal !important;
    font-size: 13px;
    margin-bottom: 6px;
    cursor: pointer;
}

.bt-radio input,
.bt-checkbox input {
    margin-right: 6px;
}

.bt-input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #c5d9b2;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.bt-input-prefix span {
    padding: 6px 10px;
    background: #f5f8f0;
    border-right: 1px solid #c5d9b2;
    font-weight: 600;
    font-size: 13px;
    color: #3d4f2f;
}

.bt-input-prefix input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1;
}

/* ── Form Rows ──────────────────────────────────────────── */

.bt-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.bt-field-half {
    flex: 1 1 calc(50% - 7px);
    min-width: 200px;
}

.bt-field-third {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 160px;
}

.bt-field-quarter {
    flex: 1 1 calc(25% - 11px);
    min-width: 130px;
}

.bt-enabled-label {
    padding-top: 24px;
}

/* ── Modal ──────────────────────────────────────────────── */

.bt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bt-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.bt-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 780px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.bt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e8eee1;
    background: #f5f8f0;
    border-radius: 8px 8px 0 0;
}

.bt-modal-header h2 {
    margin: 0;
    font-size: 17px;
    color: #2a3a1e;
}

.bt-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}

.bt-modal-close:hover {
    color: #333;
}

#bt-rule-form {
    padding: 20px 24px;
}

.bt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e8eee1;
    margin-top: 12px;
}

/* ── Select2 Tweaks ─────────────────────────────────────── */

.bt-modal .select2-container {
    width: 100% !important;
}

.bt-modal .select2-container--default .select2-selection--multiple {
    border-color: #c5d9b2;
    min-height: 36px;
    border-radius: 4px;
}

.bt-modal .select2-container--default .select2-selection--multiple:focus-within {
    border-color: #6b8e23;
    box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.15);
}

.bt-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #f5f8f0;
    border-color: #c5d9b2;
    color: #3d4f2f;
    font-size: 12px;
}

/* ── WP Buttons Override ────────────────────────────────── */

.bt-discounts-wrap .button-primary {
    background: #6b8e23;
    border-color: #5a7a1c;
    color: #fff;
}

.bt-discounts-wrap .button-primary:hover,
.bt-discounts-wrap .button-primary:focus {
    background: #5a7a1c;
    border-color: #4a6615;
    color: #fff;
}

/* ── jQuery UI Datepicker Override ───────────────────────── */

.bt-discounts-wrap .ui-datepicker {
    font-size: 13px;
}
