/**
 * Frontend styles for WooCommerce Custom Inputs - Multiple Inputs Support
 */

/* Custom Inputs Container */
.wci-custom-inputs-container {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wci-custom-inputs-wrapper {
    position: relative;
}

.wci-custom-input-field-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.wci-custom-input-field-wrapper:last-child {
    margin-bottom: 0;
}

/* Legacy support for single input */
#wci-custom-input-container {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

#wci-custom-input-container.wci-visible {
    display: block !important;
}

/* Custom Input Wrapper */
.wci-custom-input-wrapper {
    margin-bottom: 15px;
}

.wci-custom-input-wrapper:last-child {
    margin-bottom: 0;
}

/* Custom Input Label */
.wci-custom-input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wci-custom-input-label .required {
    color: #e74c3c;
    font-weight: bold;
}

/* Custom Input Field */
.wci-custom-input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    background-color: #fff;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.wci-custom-input-field:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.wci-custom-input-field.wci-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 1px #e74c3c;
}

.wci-custom-input-field.wci-valid {
    border-color: #27ae60;
}

/* Character Count */
.wci-character-count {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    text-align: right;
}

.wci-character-count.wci-warning {
    color: #f39c12;
}

.wci-character-count.wci-error {
    color: #e74c3c;
}

.wci-current-count {
    font-weight: 600;
}

/* Error Messages */
.wci-error-message {
    margin-top: 5px;
    padding: 8px 12px;
    background-color: #ffeaea;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #e74c3c;
    font-size: 13px;
    display: none;
}

.wci-error-message.wci-visible {
    display: block;
}

/* Success Messages */
.wci-success-message {
    margin-top: 5px;
    padding: 8px 12px;
    background-color: #eafaf1;
    border: 1px solid #27ae60;
    border-radius: 4px;
    color: #27ae60;
    font-size: 13px;
    display: none;
}

.wci-success-message.wci-visible {
    display: block;
}

/* Cart Display */
.wci-cart-item-meta {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.wci-cart-item-meta strong {
    color: #333;
}

/* Checkout Custom Inputs */
.wci-checkout-custom-inputs {
    margin: 20px 0;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.wci-checkout-custom-inputs h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.wci-custom-inputs-list {
    margin: 0;
}

.wci-custom-input-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wci-custom-input-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wci-custom-input-item strong {
    color: #333;
    font-weight: 600;
}

.wci-custom-input-item .quantity {
    color: #666;
    font-weight: normal;
    font-size: 13px;
}

.wci-custom-input-item .label {
    color: #555;
    font-weight: 500;
}

.wci-custom-input-item .value {
    color: #333;
    font-style: italic;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Order Details */
.wci-order-custom-inputs {
    margin: 30px 0;
}

.wci-order-custom-inputs h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.wci-order-custom-inputs-content {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
}

.wci-order-custom-input-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.wci-order-custom-input-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wci-product-name {
    margin-bottom: 8px;
}

.wci-product-name strong {
    font-size: 16px;
    color: #333;
}

.wci-product-name .quantity {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.wci-custom-input-details .wci-label {
    font-weight: 600;
    color: #555;
}

.wci-custom-input-details .wci-value {
    color: #333;
    background: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
    font-style: italic;
}

/* Order Item Meta */
.wci-order-item-meta {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.wci-order-item-meta strong {
    color: #333;
}

/* Loading States */
.wci-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wci-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 #007cba;
    border-radius: 50%;
    animation: wci-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    #wci-custom-input-container {
        margin: 15px 0;
        padding: 12px;
    }
    
    .wci-custom-input-field {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .wci-checkout-custom-inputs {
        padding: 15px;
    }
    
    .wci-order-custom-inputs-content {
        padding: 15px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wci-custom-input-field {
        border-width: 2px;
    }
    
    .wci-custom-input-field:focus {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wci-custom-input-field {
        transition: none;
    }
    
    .wci-loading::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    #wci-custom-input-container {
        background: transparent;
        border: 1px solid #000;
    }
    
    .wci-custom-input-field {
        border: 1px solid #000;
        background: transparent;
    }
    
    .wci-character-count {
        display: none;
    }
}
