/**
 * Gift Card Form - Enhanced Styling & Visual Feedback
 * Version 4.1
 */

/* ==========================================================================
   Field State Indicators
   ========================================================================== */

.gift-card-form input.valid,
.gift-card-form select.valid,
.gift-card-form textarea.valid {
    border-color: #00a32a !important;
    border-width: 2px;
}

.gift-card-form input.error,
.gift-card-form select.error,
.gift-card-form textarea.error {
    border-color: #d63638 !important;
    border-width: 2px;
    background-color: #fff8f8;
}

.gift-card-form input.valid:focus,
.gift-card-form select.valid:focus,
.gift-card-form textarea.valid:focus {
    outline: 2px solid #00a32a;
    outline-offset: 2px;
}

.gift-card-form input.error:focus,
.gift-card-form select.error:focus,
.gift-card-form textarea.error:focus {
    outline: 2px solid #d63638;
    outline-offset: 2px;
}

/* ==========================================================================
   Required Field Indicators
   ========================================================================== */

.gift-card-form .required-indicator {
    color: #d63638;
    font-weight: bold;
    margin-left: 3px;
}

.gift-card-form .form-row.required label::after {
    content: ' *';
    color: #d63638;
    font-weight: bold;
}

/* ==========================================================================
   Field Hints
   ========================================================================== */

.gift-card-form .field-hint {
    display: block;
    font-size: 12px;
    color: #757575;
    margin-top: 5px;
    font-style: italic;
}

.gift-card-form .recipient-email-field .field-hint {
    color: #0073aa;
    font-weight: 500;
}

/* ==========================================================================
   Delivery Method Selection - Enhanced
   ========================================================================== */

.gift-card-form .delivery-options {
    border: 2px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.gift-card-form .delivery-options legend {
    font-weight: 600;
    font-size: 16px;
    padding: 0 10px;
    color: #1e1e1e;
}

.gift-card-form .delivery-option {
    margin: 15px 0;
    transition: all 0.3s ease;
}

.gift-card-form .delivery-option label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.gift-card-form .delivery-option label:hover {
    border-color: #0073aa;
    background: #f0f6fc;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.gift-card-form .delivery-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.gift-card-form .delivery-option input[type="radio"]:checked + label,
.gift-card-form .delivery-option label:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #f0f6fc;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 115, 170, 0.2);
}

.gift-card-form .delivery-option strong {
    display: block;
    margin-bottom: 5px;
    color: #1e1e1e;
}

.gift-card-form .delivery-option .method-description {
    display: block;
    font-size: 13px;
    color: #757575;
    margin-top: 5px;
}

/* ==========================================================================
   Recipient Email Field - Conditional Highlighting
   ========================================================================== */

.gift-card-form .recipient-email-field {
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

.gift-card-form .recipient-email-field.required {
    background: #f0f6fc;
    border: 1px solid #c3e0f5;
}

/* ==========================================================================
   Design & Message Section
   ========================================================================== */

.gift-card-form #email-design-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px dashed #0073aa;
}

.gift-card-form #email-design-section .form-row {
    margin-bottom: 20px;
}

.gift-card-form #email-design-section label {
    color: #0073aa;
    font-weight: 600;
}

/* ==========================================================================
   Design Carousel - Enhanced
   ========================================================================== */

.gift-card-form .design-carousel-wrapper {
    position: relative;
    padding: 0 50px;
}

.gift-card-form .design-carousel {
    overflow: hidden;
    width: 100%;
}

.gift-card-form .design-carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    gap: 20px;
}

.gift-card-form .design-option {
    flex: 0 0 200px;
    min-width: 200px;
}

.gift-card-form .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #0073aa;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gift-card-form .carousel-nav:hover {
    background: #005a87;
    transform: translateY(-50%) scale(1.1);
}

.gift-card-form .carousel-nav.prev {
    left: 0;
}

.gift-card-form .carousel-nav.next {
    right: 0;
}

.gift-card-form .design-option input[type="radio"]:checked + label {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
    background: #f0f6fc;
}

.gift-card-form .design-option label {
    transition: all 0.3s ease;
}

.gift-card-form .design-option label:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Gift Message Textarea - Enhanced
   ========================================================================== */

.gift-card-form #gift_message {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
    resize: vertical;
}

.gift-card-form #gift_message:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.gift-card-form #gift_message::placeholder {
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   Loading State (for form submission)
   ========================================================================== */

.gift-card-form.submitting {
    opacity: 0.6;
    pointer-events: none;
}

.gift-card-form.submitting .submit-button::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Submit Button - Enhanced
   ========================================================================== */

.gift-card-form .submit-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    width: 100%;
    margin-top: 20px;
}

.gift-card-form .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4);
}

.gift-card-form .submit-button:active {
    transform: translateY(0);
}

.gift-card-form .submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   Transitions & Animations
   ========================================================================== */

.gift-card-form .form-row {
    transition: all 0.3s ease;
}

.gift-card-form input,
.gift-card-form select,
.gift-card-form textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Smooth show/hide for email section */
#email-design-section {
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */

@media screen and (max-width: 768px) {
    .gift-card-form .delivery-option label {
        padding: 12px;
        font-size: 14px;
    }
    
    .gift-card-form .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .gift-card-form .design-carousel-wrapper {
        padding: 0 40px;
    }
    
    .gift-card-form .submit-button {
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.gift-card-form *:focus {
    outline-offset: 2px;
}

.gift-card-form button:focus,
.gift-card-form input:focus,
.gift-card-form select:focus,
.gift-card-form textarea:focus {
    outline: 2px solid #0073aa;
}

/* Screen reader only text */
.gift-card-form .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .gift-card-form .carousel-nav,
    .gift-card-form .submit-button {
        display: none;
    }
}
