/**
 * SR Partial Payments — Admin Styles
 * Modern Premium Design
 */

/* =============================================
   SETTINGS WRAPPER & HEADER
   ============================================= */
.srpp-settings-wrap {
    max-width: 860px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.srpp-settings-wrap h1 {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.3px;
}

.srpp-settings-wrap h1::before {
    content: "💳";
    font-size: 28px;
}

/* =============================================
   SETTINGS CARD — Glassmorphism Style
   ============================================= */
.srpp-settings-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.srpp-settings-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.srpp-settings-card h2 {
    margin: 0 0 20px 0;
    padding: 0 0 14px 0;
    border-bottom: 2px solid #f1f5f9;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

/* =============================================
   TOGGLE SWITCH — Modern iOS Style
   ============================================= */
.srpp-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.srpp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.srpp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
}

.srpp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.srpp-toggle input:checked+.srpp-toggle-slider {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.srpp-toggle input:checked+.srpp-toggle-slider:before {
    transform: translateX(24px);
}

.srpp-toggle input:focus+.srpp-toggle-slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* =============================================
   FORM ELEMENTS — Clean & Modern
   ============================================= */
.srpp-settings-card .form-table th {
    padding: 16px 10px 16px 0;
    width: 220px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    vertical-align: top;
}

.srpp-settings-card .form-table td {
    padding: 16px 10px;
}

.srpp-settings-card .form-table td p.description {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.5;
}

.srpp-settings-card fieldset label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #475569;
}

.srpp-settings-card fieldset label:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.srpp-settings-card fieldset input[type="radio"]:checked+span,
.srpp-settings-card fieldset label:has(input:checked) {
    border-color: #059669;
    background: #ecfdf5;
    color: #059669;
}

.srpp-settings-card input[type="number"],
.srpp-settings-card .regular-text {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.2s ease;
    background: #ffffff;
}

.srpp-settings-card input[type="number"] {
    width: 110px;
}

.srpp-settings-card .regular-text {
    width: 160px;
}

.srpp-settings-card input[type="number"]:focus,
.srpp-settings-card .regular-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.srpp-currency {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
    margin-right: 6px;
}

/* =============================================
   CALCULATE ON — Modern Segmented Control
   ============================================= */
.srpp-settings-card .srpp-surcharge-percentage-only td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.srpp-settings-card .srpp-surcharge-percentage-only fieldset {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.srpp-settings-card .srpp-surcharge-percentage-only fieldset label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    padding: 7px 16px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 12.5px;
    color: #94a3b8;
    background: transparent;
    letter-spacing: 0.01em;
    user-select: none;
    white-space: nowrap;
}

.srpp-settings-card .srpp-surcharge-percentage-only fieldset label:hover {
    color: #64748b;
    background: rgba(255, 255, 255, 0.4);
    border-color: transparent;
}

.srpp-settings-card .srpp-surcharge-percentage-only fieldset label:has(input:checked) {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    font-weight: 600;
}

.srpp-settings-card .srpp-surcharge-percentage-only fieldset input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.srpp-settings-card .srpp-surcharge-percentage-only td > p.description {
    font-size: 11.5px !important;
    color: #b0b8c9 !important;
    margin-top: 6px !important;
    font-style: italic;
}

/* =============================================
   INFO ROW — Side by Side Layout
   ============================================= */
.srpp-info-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.srpp-info-row .srpp-settings-card {
    flex: 1;
    min-width: 0;
}

/* =============================================
   INFO CARD — Highlighted
   ============================================= */
.srpp-info-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #bbf7d0;
}

.srpp-info-card h2 {
    color: #059669;
    border-bottom-color: #bbf7d0;
}

.srpp-info-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.srpp-info-card ul li {
    padding: 8px 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid rgba(187, 247, 208, 0.4);
}

.srpp-info-card ul li:last-child {
    border-bottom: none;
}

/* Support link items */
.srpp-support-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.srpp-support-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #d1fae5;
    border-radius: 10px;
    text-decoration: none;
    color: #059669;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.srpp-support-item:hover {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
    transform: translateY(-1px);
    color: #047857;
}

.srpp-support-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* =============================================
   SUBMIT BUTTON — Gradient
   ============================================= */
.srpp-settings-wrap .submit {
    margin-top: 4px;
    padding: 0;
}

.srpp-settings-wrap .button-primary {
    padding: 10px 28px;
    height: auto;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.srpp-settings-wrap .button-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.srpp-settings-wrap .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

/* =============================================
   PAYMENT SETTINGS — Disabled State
   ============================================= */
.srpp-payment-settings {
    transition: opacity 0.4s ease;
}

/* =============================================
   ADMIN ORDER META — Styled Box
   ============================================= */
.srpp-admin-order-title {
    margin-top: 15px;
    color: #2271b1;
    font-size: 14px;
}

.srpp-admin-order-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
}

.srpp-admin-order-box p {
    margin: 6px 0;
    font-size: 13px;
}

.srpp-type-label {
    color: #ea580c;
    font-weight: 600;
}

.srpp-paid-label {
    color: #16a34a;
    font-weight: 600;
}

.srpp-cod-label {
    color: #dc2626;
    font-weight: 600;
}

/* =============================================
   ORDER LIST BADGES
   ============================================= */
.srpp-badge-partial {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.srpp-badge-full {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

/* =============================================
   SAVE CONFIRMATION TOAST
   ============================================= */
.srpp-toast {
    position: fixed;
    top: 40px;
    right: 20px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
    z-index: 999999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.srpp-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* =============================================
   COLLAPSIBLE CARDS
   ============================================= */
.srpp-collapsible-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    transition: margin-bottom 0.3s ease, padding-bottom 0.3s ease;
}

.srpp-collapsible-header:hover {
    opacity: 0.8;
}

.srpp-collapse-icon {
    font-size: 18px;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.srpp-collapsible.is-open .srpp-collapse-icon {
    transform: rotate(90deg);
}

.srpp-collapsible.is-open .srpp-collapsible-header {
    margin-bottom: 20px !important;
    padding-bottom: 14px !important;
    border-bottom: 2px solid #bbf7d0 !important;
}

.srpp-collapsible-body {
    overflow: hidden;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media screen and (max-width: 782px) {
    .srpp-settings-card {
        padding: 20px;
        border-radius: 12px;
    }

    .srpp-settings-card .form-table th {
        padding-bottom: 5px;
        width: auto;
    }

    .srpp-settings-card .form-table td {
        padding-top: 0;
    }

    .srpp-settings-card fieldset label {
        display: flex;
        margin-bottom: 8px;
    }

    .srpp-info-row {
        flex-direction: column;
    }
}