/**
 * Discount Codes CSS Styles
 */
 @font-face {
    font-family: 'iransanslight';
    src: url('../font/iransanslight.woff') format('woff');
}

/* SELECT ALL TAGS IRANSANS FONT */
* {
    font-family: 'iransanslight', sans-serif;
}

.discount-code-container {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.discount-code-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.discount-code-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.discount-code-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.discount-code-input.applied {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.discount-code-input.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.validate-discount-code,
.apply-discount-code,
.remove-discount-code {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.validate-discount-code {
    background-color: #0073aa;
    color: white;
}

.validate-discount-code:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.apply-discount-code {
    background-color: #28a745;
    color: white;
}

.apply-discount-code:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.remove-discount-code {
    background-color: #dc3545;
    color: white;
}

.remove-discount-code:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.discount-status {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 6px;
    display: none;
    align-items: center;
    gap: 10px;
}

.discount-status.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.discount-status.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.discount-status.loading {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.status-icon {
    font-size: 18px;
    font-weight: bold;
}

.status-icon.success {
    color: #28a745;
}

.status-icon.error {
    color: #dc3545;
}

.status-icon.loading {
    color: #17a2b8;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-message {
    font-size: 14px;
    font-weight: 500;
}

.discount-details {
    margin-top: 15px;
    padding: 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.discount-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.discount-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.discount-breakdown {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.discount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.discount-row:last-child {
    border-bottom: none;
}

.discount-row.total {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    border-top: 2px solid #0073aa;
    padding-top: 12px;
    margin-top: 8px;
}

.discount-amount {
    color: #28a745;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .discount-code-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .discount-code-input {
        margin-bottom: 10px;
    }
    
    .validate-discount-code,
    .apply-discount-code,
    .remove-discount-code {
        width: 100%;
    }
    
    .discount-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Loading States */
.discount-code-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.discount-code-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Success Animation */
.discount-code-container.success .discount-code-input {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Error Shake Animation */
.discount-code-container.error .discount-code-input {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Accessibility */
.discount-code-input:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.discount-code-container:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .discount-code-container {
        border-width: 2px;
    }
    
    .discount-code-input {
        border-width: 2px;
    }
    
    .discount-status {
        border-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .discount-code-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .discount-code-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .discount-details {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .discount-breakdown {
        background: #2d3748;
    }
    
    .discount-info h4 {
        color: #e2e8f0;
    }
    
    .discount-info p {
        color: #a0aec0;
    }
}
