/**
 * Voucher Custom Fields Styles
 *
 * Modern, professional styles for voucher custom fields
 *
 * @package X_Child
 * @since   1.0.0
 */

/* ==========================================================================
   Voucher Fields - Product Page
   ========================================================================== */

#voucher-custom-fields {
    margin: 25px 0;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#voucher-custom-fields h3 {
    margin: 0 0 20px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 12px;
    border-bottom: 2px solid #3498db;
}

.voucher-type-info {
    margin: 0 0 20px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
    font-size: 0.95em;
}

.voucher-fields-container {
    display: grid;
    gap: 20px;
}

.voucher-field {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
}

.voucher-field label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.voucher-field label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.voucher-field input[type="text"],
.voucher-field input[type="email"] {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #fff;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.voucher-field input[type="text"]:focus,
.voucher-field input[type="email"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.voucher-field input[type="text"].error,
.voucher-field input[type="email"].error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.field-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: #ffeaea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
    display: none; /* Standardmäßig versteckt */
}

.field-error:not(:empty) {
    display: block; /* Nur anzeigen wenn Inhalt vorhanden */
}

/* JavaScript wird explizit show() aufrufen */
.field-error.show {
    display: block !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    #voucher-custom-fields {
        margin: 20px 0;
        padding: 20px;
    }

    .voucher-field input[type="text"],
    .voucher-field input[type="email"] {
        max-width: 100%;
    }
}

/* ==========================================================================
   Voucher Info - Cart
   ========================================================================== */

.voucher-cart-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
}

.voucher-cart-info p {
    margin: 0 0 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

.voucher-cart-info p:last-child {
    margin-bottom: 0;
}

.voucher-cart-info strong {
    font-weight: 600;
    color: #333;
}

/* ==========================================================================
   Voucher Info - Order Details
   ========================================================================== */

.voucher-order-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.voucher-order-info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.voucher-order-info p:last-child {
    margin-bottom: 0;
}

.voucher-order-info strong {
    font-weight: 600;
    color: #333;
}

/* ==========================================================================
   Voucher Info - Admin Order Page
   ========================================================================== */

.voucher-admin-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.voucher-admin-info h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    border-bottom: 1px solid #ccd0d4;
    padding-bottom: 8px;
}

.voucher-item-info {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.voucher-item-info:last-child {
    margin-bottom: 0;
}

.voucher-item-info h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
}

.voucher-item-info p {
    margin: 0 0 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

.voucher-item-info p:last-child {
    margin-bottom: 0;
}

.voucher-item-info strong {
    font-weight: 600;
    color: #23282d;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .voucher-fields-wrapper {
        padding: 15px;
        margin: 15px 0;
    }

    .voucher-field {
        max-width: 100%;
        width: 100%;
    }

    .voucher-fields-wrapper h3 {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .voucher-fields-wrapper {
        padding: 10px;
        margin: 10px 0;
    }

    .voucher-field {
        padding: 8px 10px;
        font-size: 13px;
    }

    .voucher-fields-wrapper h3 {
        font-size: 1em;
        margin-bottom: 15px;
    }

    .voucher-field-wrapper {
        margin-bottom: 12px;
    }
}

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

@media print {
    .voucher-fields-wrapper,
    .voucher-cart-info,
    .voucher-order-info {
        border: 1px solid #000 !important;
        background-color: transparent !important;
    }

    .voucher-fields-wrapper h3 {
        border-bottom: 1px solid #000 !important;
    }

    .field-error {
        display: none;
    }
}
