/**
 * WP Event Tickets Frontend Styles
 * Styles for checkout forms and ticket validation
 */

/* Discount Code Validation Styles */
.wp-event-tickets-cart-fields {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.discount-code-section {
    margin-bottom: 15px;
}

.discount-code-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.discount-code-section p {
    margin-bottom: 10px;
}

.discount-code-section .form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-code-section input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.discount-code-section button {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.discount-code-section button:hover {
    background: #005a87;
}

.discount-code-section button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Validation Messages */
.validation-success {
    padding: 10px;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: bold;
}

.validation-error {
    padding: 10px;
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: bold;
}

/* Auto-fill Notification */
.auto-fill-notification {
    color: #28a745 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    font-weight: bold !important;
    padding: 5px 8px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 3px;
    display: inline-block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Attendees Section */
.attendees-section {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #ffffff;
}

.attendees-section h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.attendee-fields {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.attendee-fields h5 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.attendee-fields .form-row {
    margin-bottom: 10px;
}

.attendee-fields label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.attendee-fields input[type="text"],
.attendee-fields input[type="email"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.attendee-fields .remove-attendee {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.attendee-fields .remove-attendee:hover {
    background: #c82333;
}

#add-attendee-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

#add-attendee-btn:hover {
    background: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    .discount-code-section .form-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .discount-code-section input[type="text"] {
        margin-bottom: 10px;
    }
    
    .discount-code-section button {
        width: 100%;
    }
    
    .wp-event-tickets-cart-fields {
        margin: 10px 0;
        padding: 15px;
    }
    
    .attendee-fields {
        padding: 10px;
    }
}

/* WooCommerce Integration */
.woocommerce .wp-event-tickets-cart-fields {
    margin: 20px 0;
}

.woocommerce-checkout .wp-event-tickets-cart-fields {
    margin-bottom: 20px;
}

/* Success Icons and Colors */
.validation-success::before {
    content: "✅ ";
    margin-right: 5px;
}

.validation-error::before {
    content: "❌ ";
    margin-right: 5px;
}

.auto-fill-notification::before {
    content: "📝 ";
    margin-right: 3px;
}

/* Form Field Focus States */
.wp-event-tickets-cart-fields input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Loading States */
.discount-code-section button.loading {
    background: #ccc;
    cursor: wait;
}

.discount-code-section button.loading::after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
