/**
 * Gift Card Redemption Page Styles
 * Version: 1.1.0
 */

/* === Base Wrapper === */
.gift-card-redemption-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Steps === */
.gcr-step {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.gcr-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Hero Section === */
.gcr-hero {
    text-align: center;
    margin-bottom: 40px;
}

.gcr-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.gcr-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.gcr-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* === Cards === */
.gcr-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gcr-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

/* === Form Elements === */
.gcr-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.gcr-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.gcr-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.gcr-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.gcr-input-group .gcr-input {
    flex: 1;
    text-transform: uppercase;
}

/* === Buttons === */
.gcr-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gcr-btn-primary {
    background: #4CAF50;
    color: #fff;
}

.gcr-btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.gcr-btn-primary:active {
    transform: translateY(0);
}

.gcr-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.gcr-btn-lg {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

/* === Messages === */
.gcr-message {
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.gcr-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.gcr-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* === Help Section === */
.gcr-help {
    margin-top: 20px;
}

.gcr-help details {
    cursor: pointer;
}

.gcr-help summary {
    color: #666;
    font-size: 14px;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.gcr-help summary:hover {
    color: #4CAF50;
}

.gcr-help p {
    color: #666;
    font-size: 14px;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

/* === Trust Elements === */
.gcr-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.gcr-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.gcr-trust-icon {
    color: #4CAF50;
    font-weight: bold;
}

/* === Success Header === */
.gcr-success-header {
    text-align: center;
    margin-bottom: 30px;
}

.gcr-success-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    line-height: 80px;
    font-size: 40px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    margin-bottom: 20px;
}

.gcr-success-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.gcr-gift-info {
    font-size: 18px;
    color: #333;
    margin: 10px 0 0 0;
}

.gcr-gift-info strong {
    display: block;
    margin-bottom: 8px;
}

.gcr-covered {
    display: inline-block;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* === Form Groups === */
.gcr-form-group {
    margin-bottom: 20px;
}

.gcr-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* === Booking Calendar === */
#gcr-booking-calendar {
    min-height: 300px;
}

.gcr-calendar-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Form semplificato */
.wc-bookings-booking-form-simplified {
    padding: 0;
}

.gcr-booking-info {
    margin-bottom: 25px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.gcr-info-text {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
}

.gcr-info-desc {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.gcr-info-notice {
    margin-top: 25px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
}

.gcr-info-notice p {
    margin: 0;
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
}

/* WooCommerce Bookings Form Integration */
#gcr-booking-calendar .wc-bookings-booking-form {
    margin: 0;
}

#gcr-booking-calendar .wc-bookings-booking-form fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
}

#gcr-booking-calendar .wc-bookings-booking-form legend {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

#gcr-booking-calendar .wc-bookings-booking-form input[type="text"],
#gcr-booking-calendar .wc-bookings-booking-form input[type="date"],
#gcr-booking-calendar .wc-bookings-booking-form select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
}

#gcr-booking-calendar .wc-bookings-booking-form input[type="text"]:focus,
#gcr-booking-calendar .wc-bookings-booking-form input[type="date"]:focus,
#gcr-booking-calendar .wc-bookings-booking-form select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#gcr-booking-calendar .wc-bookings-booking-cost {
    display: none !important; /* Nascondi il costo */
}

#gcr-booking-calendar .single_add_to_cart_button {
    display: none !important; /* Nascondi il pulsante aggiungi al carrello */
}

#gcr-booking-calendar .quantity {
    display: none !important; /* Nascondi il selettore quantità */
}

/* Date Picker Styling */
#gcr-booking-calendar .ui-datepicker {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#gcr-booking-calendar .ui-datepicker-header {
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 8px 8px 0 0;
}

#gcr-booking-calendar .ui-datepicker td a {
    text-align: center;
    padding: 8px;
}

#gcr-booking-calendar .ui-datepicker td a.ui-state-active {
    background: #4CAF50;
    color: #fff;
}

.gcr-error {
    padding: 16px;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    text-align: center;
}

/* === Final Success === */
.gcr-final-success {
    text-align: center;
    padding: 40px 20px;
}

.gcr-final-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.gcr-final-success h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.gcr-final-success p {
    font-size: 18px;
    color: #666;
    margin: 0 0 30px 0;
}

.gcr-order-summary {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
}

.gcr-order-summary h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 15px 0;
}

#gcr-final-details {
    color: #333;
    line-height: 1.8;
}

.gcr-order-number {
    font-size: 16px;
    color: #666;
    margin-top: 20px;
}

.gcr-order-number strong {
    color: #4CAF50;
}

/* === Loading Overlay === */
.gcr-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.gcr-loading.active {
    display: flex;
}

.gcr-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 600px) {
    .gift-card-redemption-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .gcr-hero h1 {
        font-size: 26px;
    }
    
    .gcr-subtitle {
        font-size: 16px;
    }
    
    .gcr-card {
        padding: 20px;
    }
    
    .gcr-input-group {
        flex-direction: column;
    }
    
    .gcr-input-group .gcr-btn {
        width: 100%;
    }
    
    .gcr-trust {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === Iframe Styles === */
.gcr-iframe-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.gcr-iframe-loading {
    padding: 40px;
}

.gcr-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#gcr-booking-iframe {
    transition: opacity 0.3s ease;
}

.gcr-selection-confirmed {
    background: #e8f5e9;
    border: 1px solid #4CAF50;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.gcr-selection-confirmed h4 {
    margin: 0 0 10px 0;
    color: #2e7d32;
}

.gcr-selection-confirmed p {
    margin: 0;
}
