/**
 * Amelia Booking Integration Styles
 * 
 * Styles for gift card widget in Amelia booking flow
 */

/* Widget Container */
.amelia-gifts-widget {
    margin-top: 20px;
    margin-bottom: 28px !important;
    background: none !important;
    border: 2px solid rgba(26,44,55,0.2);
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
}

/* Widget Header */
.amelia-gifts-widget .widget-header {
    background: #231f1e;
    margin-bottom: 8px !important;
    padding: 8px 12px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
}

.amelia-gifts-widget .gift-icon {
    font-size: 28px;
}

.amelia-gifts-widget .widget-header h3 {
    margin: 0;
    color: #fff;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* Widget Body */
.amelia-gifts-widget .widget-body {
    padding: 18px;
}

/* Card Selector */
.amelia-gifts-widget .card-selector {
    margin-bottom: 14px;
}

.amelia-gifts-widget .card-selector label {
    display: block;
    margin-bottom: 4px !important;
    padding-left: 4px !important;
    font-weight: 600 !important;
    color: #231f1e;
    font-size: 13px !important;
}

.amelia-gifts-widget .gift-card-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.amelia-gifts-widget .manual-toggle {
    margin-top: 4px;
    background: none;
    border: none;
    padding: 0;
    padding-left: 4px;
    color: #231f1e;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.amelia-gifts-widget .widget-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
}

.amelia-gifts-widget .gift-card-select:hover {
    border-color: #9ca3af;
}

.amelia-gifts-widget .gift-card-select:focus {
    outline: none;
    border-color: #caa464;
    box-shadow: 0 0 0 3px rgba(202, 164, 100, 0.15);
}

/* Divider */
.amelia-gifts-widget .divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.amelia-gifts-widget .divider::before,
.amelia-gifts-widget .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e5e7eb;
}

.amelia-gifts-widget .divider::before {
    left: 0;
}

.amelia-gifts-widget .divider::after {
    right: 0;
}

.amelia-gifts-widget .divider span {
    background: #fff;
    padding: 0 12px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Code Input Group */
.amelia-gifts-widget .code-input-group {
    margin-top: 10px;
}

.amelia-gifts-widget .code-input-group label {
    display: block;
    padding-left: 4px !important;
    margin-bottom: 4px !important;
    font-weight: 600 !important;
    color: #231f1e;
    font-size: 13px !important;
}

.amelia-gifts-widget .input-wrapper {
    display: flex;
    gap: 10px;
}

.amelia-gifts-widget .gift-card-code-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.amelia-gifts-widget .gift-card-code-input:hover {
    border-color: #9ca3af;
}

.amelia-gifts-widget .gift-card-code-input:focus {
    outline: none;
    border-color: #caa464;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.amelia-gifts-widget .gift-card-code-input::placeholder {
    color: #9ca3af;
    letter-spacing: normal;
}

/* Apply Button */
.amelia-gifts-widget .apply-btn {
    margin-top: 12px;
    background: #caa464;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.amelia-gifts-widget .apply-btn:hover:not(:disabled) {
    background: #b88946;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(202, 164, 100, 0.35);
}

.amelia-gifts-widget .apply-btn:active:not(:disabled) {
    transform: translateY(0);
}

.amelia-gifts-widget .apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Result Display */
.amelia-gifts-widget .gift-card-result {
    background: none !important;
    padding: 16px !important;
}

.amelia-gifts-widget .result-success {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.amelia-gifts-widget .result-success .checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

.amelia-gifts-widget .result-success .message {
    color: #171717;
    font-weight: 600;
    font-size: 14px;
}

.amelia-gifts-widget .discount-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px !important;
    background: none !important;
    border-radius: 6px;
    margin-bottom: 15px;
}

.amelia-gifts-widget .discount-info .label {
    color: #171717 !important;
    font-weight: 600 !important;
}

.amelia-gifts-widget .discount-info .amount {
    color: #171717;
    font-weight: 700;
    font-size: 16px;
}

/* Remove Button */
.amelia-gifts-widget .remove-btn {
    background: #fff;
    color: #caa464;
    border: 2px solid #caa464;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.amelia-gifts-widget .remove-btn:hover {
    background: #caa464;
    color: #181818;
}

/* Error Display */
.amelia-gifts-widget .gift-card-error {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: 14px;
    margin-top: 12px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .amelia-gifts-widget {
        margin: 15px 0;
    }
    
    .amelia-gifts-widget .widget-body {
        padding: 20px 16px;
    }
    
    .amelia-gifts-widget .input-wrapper {
        flex-direction: column;
    }
    
    .amelia-gifts-widget .apply-btn {
        width: 100%;
    }
    
    .amelia-gifts-widget .widget-header h3 {
        font-size: 16px;
    }
}

/* Loading Animation */
.amelia-gifts-widget .apply-btn:disabled::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Integration with Amelia Styles */
.amelia-app-booking .amelia-gifts-widget,
.amelia-container .amelia-gifts-widget,
#amelia-app-booking .amelia-gifts-widget,
.amelia-v2-booking .amelia-gifts-widget {
    /* Ensure widget fits nicely in Amelia's layout */
    max-width: 100%;
}

/* Price Strike-through when discount applied */
.amelia-gifts-widget-active .am-total-price.original {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Smooth transitions */
.amelia-gifts-widget * {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.amelia-gifts-widget button:focus,
.amelia-gifts-widget input:focus,
.amelia-gifts-widget select:focus {
    outline: 2px solid #caa464;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .amelia-gifts-widget {
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .amelia-gifts-widget .widget-header {
        background: #caa464;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .amelia-gifts-widget .apply-btn,
    .amelia-gifts-widget .remove-btn {
        display: none;
    }
}
