/**
 * Frontend CSS for Over PDF Generator
 */

.over-pdf-coupon-section {
    background: #f8f9fa;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.over-pdf-coupon-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0073aa, #005a87);
    border-radius: 10px;
    z-index: -1;
}

.over-pdf-coupon-section h3 {
    color: #0073aa;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.over-pdf-coupon-input {
    text-align: center;
}

.coupon-field-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.over-pdf-coupon-code {
    flex: 1;
    max-width: 300px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.3s ease;
}

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

.over-pdf-coupon-code::placeholder {
    color: #999;
    text-transform: none;
    letter-spacing: normal;
}

.apply-over-pdf-coupon {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-over-pdf-coupon:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.apply-over-pdf-coupon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.apply-over-pdf-coupon .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

.coupon-description {
    color: #666;
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

/* Applied coupon styles */
.over-pdf-coupon-applied {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.coupon-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #155724;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.coupon-discount {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    display: inline-block;
}

.remove-over-pdf-coupon {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-over-pdf-coupon:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.remove-over-pdf-coupon .dashicons {
    margin-right: 3px;
    vertical-align: middle;
}

/* Loading states */
.over-pdf-coupon-code:disabled,
.apply-over-pdf-coupon:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.apply-over-pdf-coupon:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Success/Error messages */
.over-pdf-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: bold;
    text-align: center;
}

.over-pdf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.over-pdf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive design */
@media (max-width: 768px) {
    .coupon-field-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .over-pdf-coupon-code {
        max-width: 100%;
    }
    
    .over-pdf-coupon-applied {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .coupon-info {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .over-pdf-coupon-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .over-pdf-coupon-section h3 {
        font-size: 16px;
    }
    
    .over-pdf-coupon-code {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .apply-over-pdf-coupon {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Animation for coupon application */
@keyframes couponApplied {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.over-pdf-coupon-applied {
    animation: couponApplied 0.3s ease-out;
}

/* Hover effects for better UX */
.over-pdf-coupon-section:hover {
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.over-pdf-coupon-code:hover {
    border-color: #0073aa;
}

/* Focus states for accessibility */
.apply-over-pdf-coupon:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.remove-over-pdf-coupon:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

/* Print styles */
@media print {
    .over-pdf-coupon-section {
        border: 1px solid #000;
        background: white;
        box-shadow: none;
    }
    
    .over-pdf-coupon-section::before {
        display: none;
    }
    
    .apply-over-pdf-coupon,
    .remove-over-pdf-coupon {
        display: none;
    }
}
