/* Tiers Container */
#truebeep-tiers-container {
    max-width: 100%;
}

#truebeep-tiers-table {
    margin-bottom: 20px;
}

#truebeep-tiers-table th {
    font-weight: 600;
    padding: 10px;
}

#truebeep-tiers-table td {
    padding: 10px;
}

#truebeep-tiers-table .edit-tier {
    margin-right: 5px;
}

#truebeep-tiers-table .remove-tier {
    color: #a00;
}

#truebeep-tiers-table .remove-tier:hover {
    color: #dc3232;
    border-color: #dc3232;
}

#add-tier-button,
#add-coupon-button {
    margin-right: 10px;
}

#save-coupons-button {
    margin-left: 10px;
}

.tier-row {
    transition: background-color 0.3s ease;
}

.tier-row:hover {
    background-color: #f9f9f9;
}

.description {
    color: #666;
    font-style: italic;
}

/* Modal Styles */
.tier-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.tier-modal-content {
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    width: 600px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transform: translateZ(0);
}

.tier-modal-header {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tier-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.tier-modal-close,
.coupon-modal-close {
    color: #6c757d;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tier-modal-close:hover,
.tier-modal-close:focus,
.coupon-modal-close:hover,
.coupon-modal-close:focus {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    text-decoration: none;
    transform: scale(1.1);
}

.tier-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.tier-modal-body .form-table {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tier-modal-body .form-table th {
    width: 180px;
    padding: 15px 15px 15px 0;
    font-weight: 600;
    color: #2c3e50;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.tier-modal-body .form-table td {
    padding: 15px 0;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

.tier-modal-body .form-table tr:last-child th,
.tier-modal-body .form-table tr:last-child td {
    border-bottom: none;
}

.tier-modal-body .regular-text {
    width: 100%;
    max-width: 350px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.tier-modal-body .regular-text:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

.tier-modal-footer {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.tier-modal-footer .button {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tier-modal-footer .button-primary {
    background-color: #0073aa;
    border-color: #0073aa;
}

.tier-modal-footer .button-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
}

/* Ensure modal displays properly */
#tier-edit-modal,
#coupon-edit-modal {
    display: none;
}

#tier-edit-modal.show,
#coupon-edit-modal.show {
    display: flex !important;
}

/* Force flexbox centering when modal is visible */
#tier-edit-modal[style*="display: block"],
#coupon-edit-modal[style*="display: block"] {
    display: flex !important;
}

/* Radio button styling for Ways to Redeem */
.forminp-radio {
    padding-top: 10px;
}

.forminp-radio label {
    display: block;
    margin-bottom: 10px;
}

.forminp-radio input[type="radio"] {
    margin-right: 8px;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .tier-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .tier-modal-body .form-table th {
        width: 100%;
        padding-bottom: 5px;
    }
    
    .tier-modal-body .form-table td {
        padding-left: 0;
    }
    
    #truebeep-tiers-table {
        font-size: 12px;
    }
    
    #truebeep-tiers-table th,
    #truebeep-tiers-table td {
        padding: 5px;
    }
}