/**
 * FLHIP Coupon Styles
 * 
 * Styles for the coupon input, applied coupon display, and discount messaging.
 * Save as: /wp-content/plugins/flhip-region-subscriptions/assets/css/coupon.css
 */

/* ==========================================================================
   Coupon Container
   ========================================================================== */

.flhip-coupon-section {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.flhip-coupon-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

#flhip-coupon-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   Coupon Input
   ========================================================================== */

#flhip-coupon-code {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-transform: uppercase;
    transition: border-color 0.2s ease;
}

#flhip-coupon-code:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

#flhip-coupon-code:disabled {
    background: #f5f5f5;
    color: #666;
}

#flhip-coupon-code::placeholder {
    text-transform: none;
    color: #999;
}

/* ==========================================================================
   Apply Button
   ========================================================================== */

#flhip-apply-coupon {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#flhip-apply-coupon:hover {
    background: #005a87;
}

#flhip-apply-coupon:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Applied Coupon Badge
   ========================================================================== */

.flhip-applied-coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 4px;
}

.flhip-applied-coupon .coupon-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #2e7d32;
}

.flhip-applied-coupon .coupon-icon {
    font-style: normal;
}

.flhip-remove-coupon {
    padding: 4px 8px;
    font-size: 12px;
    color: #666;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flhip-remove-coupon:hover {
    color: #d32f2f;
    border-color: #d32f2f;
    background: #ffebee;
}

/* ==========================================================================
   Coupon Messages
   ========================================================================== */

#flhip-coupon-message {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 4px;
    display: none;
}

#flhip-coupon-message.success {
    display: block;
    color: #2e7d32;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

#flhip-coupon-message.error {
    display: block;
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ef9a9a;
}

#flhip-coupon-message.info {
    display: block;
    color: #1565c0;
    background: #e3f2fd;
    border: 1px solid #90caf9;
}

/* ==========================================================================
   Pricing with Discount
   ========================================================================== */

.flhip-pricing-summary {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.flhip-pricing-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.flhip-pricing-line .label {
    color: #555;
}

.flhip-pricing-line .amount {
    font-weight: 500;
    color: #333;
}

.flhip-discount-line {
    color: #2e7d32 !important;
    border-top: 1px dashed #e0e0e0;
}

.flhip-discount-line .label,
.flhip-discount-line .amount {
    color: #2e7d32;
}

.flhip-original-price {
    text-align: right;
    font-size: 13px;
    color: #999;
    margin-bottom: 5px;
}

.flhip-original-price s {
    color: #999;
}

#flhip-total-price {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
}

#flhip-total-price.has-discount {
    color: #2e7d32;
}

#flhip-total-price strong {
    font-size: 20px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 600px) {
    #flhip-coupon-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    #flhip-coupon-code {
        max-width: none;
    }
    
    #flhip-apply-coupon {
        width: 100%;
    }
    
    .flhip-applied-coupon {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Order Review / Checkout Page Coupon Display
   ========================================================================== */

.flhip-order-coupon-summary {
    margin: 15px 0;
    padding: 12px 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 0 4px 4px 0;
}

.flhip-order-coupon-summary .coupon-label {
    font-weight: 600;
    color: #2e7d32;
}

.flhip-order-coupon-summary .coupon-discount {
    float: right;
    font-weight: 600;
    color: #2e7d32;
}

/* ==========================================================================
   Admin Coupon Management (if needed)
   ========================================================================== */

.flhip-admin-coupon-list {
    width: 100%;
    border-collapse: collapse;
}

.flhip-admin-coupon-list th,
.flhip-admin-coupon-list td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.flhip-admin-coupon-list th {
    background: #f5f5f5;
    font-weight: 600;
}

.flhip-coupon-status {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 3px;
}

.flhip-coupon-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.flhip-coupon-status.inactive {
    background: #f5f5f5;
    color: #666;
}

.flhip-coupon-status.expired {
    background: #ffebee;
    color: #c62828;
}