/**
 * Product Coupons – Admin Styles
 *
 * @package WC_Product_Coupons
 */

/* ========== Admin Wrap ========== */
.wcpc-admin-wrap {
    max-width: 1200px;
}

.wcpc-admin-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.wcpc-version {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

/* ========== Action Bar ========== */
.wcpc-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.wcpc-btn-add-new {
    background-color: #00a32a !important;
    border-color: #00a32a !important;
}

.wcpc-btn-add-new:hover {
    background-color: #008a20 !important;
    border-color: #008a20 !important;
}

.wcpc-btn-import {
    cursor: pointer;
}

/* ========== Cards Table ========== */
.wcpc-cards-table .wcpc-col-title {
    width: 20%;
}

.wcpc-cards-table .wcpc-col-code code {
    background: #f0f0f1;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.wcpc-cards-table .wcpc-col-badge {
    width: 12%;
}

.wcpc-cards-table .wcpc-col-products {
    width: 15%;
}

.wcpc-cards-table .wcpc-col-priority {
    width: 8%;
    text-align: center;
}

.wcpc-cards-table .wcpc-col-mobile {
    width: 8%;
    text-align: center;
}

.wcpc-cards-table .wcpc-col-actions {
    width: 15%;
}

.wcpc-cards-table .wcpc-col-actions .button {
    margin-right: 4px;
}

.wcpc-no-cards td {
    text-align: center;
    padding: 30px !important;
    color: #999;
    font-style: italic;
}

/* ========== Modal ========== */
.wcpc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    overflow-y: auto;
}

.wcpc-modal {
    background: #fff;
    border-radius: 8px;
    width: 95%;
    max-width: 960px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    animation: wcpc-modal-in 0.2s ease-out;
}

@keyframes wcpc-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcpc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.wcpc-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.wcpc-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 3px;
    line-height: 1;
}

.wcpc-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.wcpc-modal-body {
    padding: 24px;
}

.wcpc-modal-footer {
    padding: 16px 0 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* ========== Form Layout ========== */
.wcpc-form-row {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.wcpc-form-col {
    flex: 1;
    min-width: 0;
}

/* Ensure PRO sections always render as full-width blocks inside the column */
.wcpc-form-col .wcpc-pro-section {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.wcpc-preview-col {
    flex: 0 0 320px;
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

.wcpc-field-group {
    margin-bottom: 14px;
}

.wcpc-field-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #1d2327;
}

.wcpc-field-group label .required {
    color: #d63638;
}

.wcpc-field-group input[type="text"],
.wcpc-field-group input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
}

.wcpc-field-group input[type="text"]:focus,
.wcpc-field-group input[type="number"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.wcpc-field-row-inline {
    display: flex;
    gap: 12px;
}

.wcpc-field-half {
    flex: 1;
}

/* ========== Coupon Field ========== */
.wcpc-coupon-field-wrap {
    position: relative;
}

.wcpc-coupon-field-wrap input {
    text-transform: uppercase;
}

.wcpc-coupon-status {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
}

.wcpc-coupon-status.valid {
    color: #00a32a;
}

.wcpc-coupon-status.invalid {
    color: #d63638;
}

/* ========== Toggle ========== */
.wcpc-toggle-wrap {
    padding-top: 4px;
}

.wcpc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.wcpc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wcpc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

.wcpc-toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.2s;
    border-radius: 50%;
}

.wcpc-toggle input:checked + .wcpc-toggle-slider {
    background-color: #2271b1;
}

.wcpc-toggle input:checked + .wcpc-toggle-slider::before {
    transform: translateX(20px);
}

.wcpc-toggle input:focus + .wcpc-toggle-slider {
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.4);
}

/* ========== Live Preview ========== */
.wcpc-preview-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #f9f9f9;
}

.wcpc-preview-col h3 {
    font-size: 14px;
    margin: 0 0 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Preview card (reuses frontend card styles inline) */
.wcpc-preview-card {
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.wcpc-preview-card .wcpc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.wcpc-preview-card .wcpc-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.wcpc-preview-card .wcpc-card-badge {
    background: #FF6B6B;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    transform: rotate(-2deg);
}

.wcpc-preview-card .wcpc-card-subtitle {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    margin: 0 0 12px;
    line-height: 1.4;
}

.wcpc-preview-card .wcpc-card-code-box {
    background: #F0F0F0;
    border: 2px dashed rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    margin-bottom: 12px;
}

.wcpc-preview-card .wcpc-coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wcpc-preview-card .wcpc-card-actions {
    display: flex;
    gap: 8px;
}

.wcpc-preview-card .wcpc-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: default;
    text-align: center;
    color: #fff;
}

.wcpc-preview-card .wcpc-btn-copy {
    background: #FF6B6B;
}

.wcpc-preview-card .wcpc-btn-apply {
    background: #96588A;
}

/* ========== Admin Notices (inline) ========== */
.wcpc-notice {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    animation: wcpc-notice-in 0.3s ease-out;
}

@keyframes wcpc-notice-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcpc-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcpc-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wcpc-notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ========== Color Picker Overrides ========== */
.wcpc-field-group .wp-picker-container {
    display: flex;
    align-items: center;
}

.wcpc-field-group .wp-picker-container .wp-color-result {
    margin-right: 8px;
}

/* ========== Responsive ========== */
@media screen and (max-width: 782px) {
    .wcpc-form-row {
        flex-direction: column;
    }

    .wcpc-preview-col {
        flex: none;
        position: static;
    }

    .wcpc-field-row-inline {
        flex-direction: column;
    }

    .wcpc-modal {
        width: 98%;
        max-height: calc(100vh - 40px);
    }
}

/* Side-by-side field layout */
.wcpc-field-row {
    display: flex;
    gap: 12px;
}

.wcpc-field-group small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #999;
}


/* ========== Settings Bar ========== */
.wcpc-settings-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.wcpc-settings-bar select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #8c8f94;
}

.wcpc-layout-saved {
    color: #00a32a;
    font-size: 13px;
    font-weight: 500;
}




