/**
 * Coupon UI Styles
 *
 * Styling for coupon entry box, price displays, and related UI elements.
 */

/* Coupon Entry Box */
.coupon-entry-box {
    display: none;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.coupon-entry-box label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

.coupon-entry-box input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

input#coupon-code-input {
    font-size: 14px;
    border-radius: 5px;
}

.coupon-entry-box input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.coupon-entry-box .coupon-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.coupon-entry-box button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.coupon-buttons button {
    background: #635bff;
    color: #fff;
    border-radius: 9999px;
    line-height: 1;
    padding: 4.5px 10px;
    font-size: 14px;
}

.apply-coupon-btn {
    background-color: #3b82f6;
    color: white;
}

.apply-coupon-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.apply-coupon-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.skip-coupon-btn {
    background-color: #e5e7eb;
    color: #374151;
}

.skip-coupon-btn:hover {
    background-color: #d1d5db;
}

/* Coupon Message Display */
.coupon-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.coupon-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.coupon-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.coupon-message.loading {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.coupon-message:empty {
    display: none;
}

/* Price Display with Coupon */
.workshop-price {
    margin: 16px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.workshop-price .price {
    font-weight: 700;
    font-size: 28px;
    color: #111827;
}

.workshop-price .original-price {
    font-weight: 600;
    font-size: 20px;
    color: #9ca3af;
}

.workshop-price .original-price.strikethrough {
    text-decoration: line-through;
}

.workshop-price .discounted-price {
    font-weight: 700;
    font-size: 28px;
    color: #059669;
}

.workshop-price .coupon-applied {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background-color: #d1fae5;
    color: #065f46;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
}

.workshop-price .coupon-applied::before {
    content: '✓';
    font-weight: 700;
}

/* Coupon Toggle Link */
.coupon-toggle {
    color: #3b82f6;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a.coupon-toggle {
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #635bff;
}

.coupon-toggle:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Remove Coupon Link */
.remove-coupon {
    color: #dc2626;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.remove-coupon:hover {
    color: #991b1b;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 640px) {
    .workshop-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .coupon-entry-box {
        padding: 16px;
    }

    .coupon-entry-box input[type="text"] {
        max-width: 100%;
    }

    .coupon-entry-box .coupon-buttons {
        width: 100%;
    }

    .coupon-entry-box button {
        flex: 1;
        min-width: 0;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coupon-entry-box {
    animation: slideDown 0.3s ease-out;
}

/* Admin Coupon Edit Screen Styles */
.coupon-usage-stats {
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 6px;
}

.coupon-usage-stats p {
    margin: 8px 0;
    font-size: 14px;
}

.coupon-usage-stats strong {
    color: #374151;
    font-weight: 600;
}

/* Form Table Styling for Admin */
.form-table th {
    width: 200px;
}

.form-table select[multiple] {
    height: auto;
    min-height: 150px;
}

.form-table .description {
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
    margin-top: 6px;
}
