/* ==========================================================================
   Admin Markup Pricing — dashboard.css
   ========================================================================== */

/* Table wrapper (horizontal scroll on mobile)
   -------------------------------------------------------------------------- */
.amp-table-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.amp-table-wrapper:active {
    cursor: grabbing;
}

/* Scroll fade indicators */
.amp-table-wrapper::before,
.amp-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 10;
    transition: opacity .25s ease;
}
.amp-table-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,.9), transparent);
}
.amp-table-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,.9), transparent);
}
.amp-table-wrapper.amp-at-left::before  { opacity: 0; }
.amp-table-wrapper.amp-at-right::after  { opacity: 0; }

/* Refresh / actions bar
   -------------------------------------------------------------------------- */
.amp-actions-bar {
    text-align: right;
    margin: 1em 0;
}

/* Table — base
   -------------------------------------------------------------------------- */
.amp-dashboard .woocommerce-table {
    min-width: 580px;
    width: 100%;
}

.amp-dashboard .woocommerce-table th,
.amp-dashboard .woocommerce-table td {
    vertical-align: middle;
    white-space: nowrap;
}

/* Multiplier cell
   -------------------------------------------------------------------------- */
.amp-multiplier-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amp-multiplier-input {
    width: 100px !important;
    padding: 6px 10px !important;
    height: auto !important;
}

/* Percentage badges — inline table
   -------------------------------------------------------------------------- */
.amp-pct-inline {
    display: inline-block;
    font-size: .8em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 52px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.amp-pct-inline.positive { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.amp-pct-inline.negative { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* Percentage display — form
   -------------------------------------------------------------------------- */
.amp-pct-display {
    margin-top: 5px;
    font-size: .82em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    min-width: 120px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.amp-pct-display.positive { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.amp-pct-display.negative { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* Conflict warning
   -------------------------------------------------------------------------- */
.amp-conflict-warning {
    background:  #fff3cd;
    border:      1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    padding:     14px 16px;
    margin:      14px 0;
    border-radius: 4px;
    color:       #856404;
    line-height: 1.5;
}

.amp-conflict-warning strong { color: #d68910; }

/* Delete button overrides
   -------------------------------------------------------------------------- */
.amp-delete-rule {
    background-color: #e74c3c !important;
    color:            #fff    !important;
    border-color:     #c0392b !important;
}

.amp-delete-rule:hover {
    background-color: #c0392b !important;
}

/* Form layout
   -------------------------------------------------------------------------- */
.amp-form-section {
    margin-top: 2em;
}

.amp-form-section h2 {
    margin-bottom: .75em;
}

.form-row-half {
    display: inline-block;
    width: 48%;
    vertical-align: top;
}

.form-row-half:first-child {
    margin-right: 4%;
}

#amp-submit-btn {
    margin-top: 10px;
}

.woocommerce-table__product-actions .button {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .form-row-half {
        width: 100%;
        margin-right: 0;
        display: block;
    }

    .amp-dashboard .woocommerce-table th,
    .amp-dashboard .woocommerce-table td {
        padding: 8px 6px;
        font-size: 13px;
    }

    .amp-multiplier-input {
        width: 80px !important;
    }

    .woocommerce-table__product-actions .button {
        font-size: 12px;
        padding: 5px 8px;
    }

    .amp-actions-bar {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .amp-dashboard .woocommerce-table th,
    .amp-dashboard .woocommerce-table td {
        padding: 6px 4px;
        font-size: 12px;
    }
}
