/**
 * Frontend CSS for Gift Card Redemption
 */

/* Gift Card Section */
.wgcr-gift-card-section {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wgcr-gift-card-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Gift Card Input */
.wgcr-gift-card-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.wgcr-gift-card-input input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.wgcr-gift-card-input input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wgcr-gift-card-input input[type="text"].wgcr-invalid-code {
    border-color: #dc3232;
    box-shadow: 0 0 0 3px rgba(220, 50, 50, 0.1);
}

.wgcr-gift-card-input button {
    padding: 12px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.wgcr-gift-card-input button:hover {
    background: #005a87;
}

.wgcr-gift-card-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.wgcr-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
}

.wgcr-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wgcr-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Applied Gift Cards */
.wgcr-applied-cards {
    margin-top: 15px;
}

.wgcr-applied-cards-list {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.wgcr-applied-cards-list h4 {
    margin: 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.wgcr-applied-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.wgcr-applied-card:last-child {
    border-bottom: none;
}

.wgcr-applied-card:hover {
    background: #f8f9fa;
}

.wgcr-card-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wgcr-card-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
}

.wgcr-remove-card {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wgcr-remove-card:hover {
    background: #f8d7da;
}

.wgcr-remove-card .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Review Order Section */
.wgcr-review-gift-cards {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.wgcr-review-gift-cards h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wgcr-review-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.wgcr-review-card:last-child {
    border-bottom: none;
}

.wgcr-review-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.wgcr-review-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 13px;
}

/* Cart Total Display */
.wgcr-gift-card-total span:first-child {
    color: #666;
}

.wgcr-gift-card-total span:last-child {
    color: #28a745;
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wgcr-gift-card-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .wgcr-gift-card-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .wgcr-gift-card-input button {
        width: 100%;
    }
    
    .wgcr-applied-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wgcr-applied-card .wgcr-remove-card {
        align-self: flex-end;
    }
    
    .wgcr-review-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Loading States */
.wgcr-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wgcr-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: wgcr-spin 1s linear infinite;
}

@keyframes wgcr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.wgcr-gift-card-section:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wgcr-remove-card:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wgcr-gift-card-section {
        border: 2px solid #000;
    }
    
    .wgcr-gift-card-input input[type="text"] {
        border: 2px solid #000;
    }
    
    .wgcr-gift-card-input button {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wgcr-gift-card-input input[type="text"],
    .wgcr-gift-card-input button,
    .wgcr-applied-card,
    .wgcr-remove-card {
        transition: none;
    }
    
    .wgcr-loading::after {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wgcr-gift-card-section {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wgcr-gift-card-section h3 {
        color: #e2e8f0;
    }
    
    .wgcr-gift-card-input input[type="text"] {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .wgcr-gift-card-input input[type="text"]:focus {
        border-color: #63b3ed;
    }
    
    .wgcr-applied-cards-list {
        background: #4a5568;
        border-color: #718096;
    }
    
    .wgcr-applied-cards-list h4 {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .wgcr-applied-card {
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .wgcr-applied-card:hover {
        background: #2d3748;
    }
    
    .wgcr-card-code {
        color: #e2e8f0;
    }
    
    .wgcr-review-gift-cards {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .wgcr-review-gift-cards h3 {
        color: #e2e8f0;
    }
    
    .wgcr-review-card {
        border-color: #718096;
    }
    
    .wgcr-review-code {
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .wgcr-gift-card-section {
        background: white;
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .wgcr-gift-card-input button,
    .wgcr-remove-card {
        display: none;
    }
} 