/**
 * Frontend CSS for WC Socios plugin
 */

/* Checkout Fields Styling */
#wc-socios-fields {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

#wc-socios-fields h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.wc-socios-info {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Validation Button */
.wc-socios-validate-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.wc-socios-validate-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.wc-socios-validate-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.wc-socios-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    font-size: 14px;
    margin: 10px 0;
}

.wc-socios-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Field States */
#socio_dni.validating {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#socio_dni.wc-socios-validation-success {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2);
}

#socio_dni.wc-socios-validation-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Validation Messages */
#wc-socios-validation-message {
    margin: 15px 0;
}

.wc-socios-message {
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    margin: 5px 0;
}

.wc-socios-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wc-socios-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wc-socios-message-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.wc-socios-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

#wc-socios-validation-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#wc-socios-validation-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Member Info Display */
.wc-socios-member-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.wc-socios-member-info h4 {
    margin: 0 0 10px 0;
    color: #155724;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-socios-member-info p {
    margin: 5px 0;
    color: #155724;
}

.wc-socios-pricing-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 13px;
    color: #856404;
    font-style: italic;
}

/* Product Page Pricing Info */
.wc-socios-price-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.wc-socios-price-active {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-socios-price-available {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
}

.wc-socios-price-available small {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.wc-socios-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Shop Loop Pricing */
.wc-socios-loop-price-active {
    margin: 8px 0;
}

.wc-socios-loop-price-available {
    margin: 8px 0;
}

.wc-socios-badge {
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-socios-badge-available {
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price Suffix */
.wc-socios-price-suffix {
    color: #27ae60;
    font-size: 12px;
    font-weight: 500;
    margin-left: 5px;
}

/* Animations */
.wc-socios-fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.wc-socios-success-pulse {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* Notifications */
.wc-socios-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-socios-notification.show {
    transform: translateX(0);
}

.wc-socios-notification-success {
    background: #27ae60;
}

.wc-socios-notification-error {
    background: #e74c3c;
}

.wc-socios-notification-info {
    background: #3498db;
}

/* Member Info Toggle */
.wc-socios-member-info-toggle {
    background: none;
    border: none;
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin: 10px 0;
}

.wc-socios-member-info-toggle:hover {
    color: #2980b9;
}

.wc-socios-member-info-content {
    display: none;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    #wc-socios-fields {
        padding: 15px;
        margin: 15px 0;
    }
    
    #wc-socios-fields h3 {
        font-size: 16px;
    }
    
    .wc-socios-validate-btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .wc-socios-price-info {
        padding: 12px;
        margin: 12px 0;
    }
    
    .wc-socios-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .wc-socios-notification.show {
        transform: translateY(0);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #wc-socios-fields {
        border: 2px solid #000;
    }
    
    .wc-socios-validate-btn {
        border: 2px solid #000;
    }
    
    #wc-socios-validation-message.success {
        border: 2px solid #000;
    }
    
    #wc-socios-validation-message.error {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .wc-socios-validate-btn,
    .wc-socios-fade-in,
    .wc-socios-success-pulse,
    .wc-socios-notification {
        animation: none;
        transition: none;
    }
    
    .wc-socios-loading .spinner {
        animation: none;
        border: 2px solid #3498db;
        border-top: 2px solid #e9ecef;
    }
}

/* WooCommerce Blocks Specific Styles */
.wc-socios-fields {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.wc-socios-fields h3 {
    margin: 0 0 15px 0 !important;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.wc-socios-fields .components-text-control__input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

.wc-socios-fields .components-text-control__input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.wc-socios-fields .components-button {
    background: #3498db !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wc-socios-fields .components-button:hover {
    background: #2980b9 !important;
}

.wc-socios-fields .components-button:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed;
}

.wc-socios-fields .components-notice {
    margin: 15px 0 !important;
    padding: 12px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
}

.wc-socios-fields .components-notice.is-success {
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
}

.wc-socios-fields .components-notice.is-error {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
}

/* Print Styles */
@media print {
    #wc-socios-fields,
    .wc-socios-fields,
    .wc-socios-validate-btn,
    .wc-socios-loading,
    .wc-socios-notification {
        display: none !important;
    }
    
    .wc-socios-member-info {
        background: none;
        border: 1px solid #000;
    }
}

/* Ocultar formulario cuando está validado */
#wc-socios-fields.validado .form-row {
    display: none !important;
}

#wc-socios-fields.validado .wc-socios-info {
    display: none !important;
}

#wc-socios-fields.validado #wc-socios-validate-btn {
    display: none !important;
}

/* Estilo para mensaje de éxito */
.wc-socios-message.wc-socios-success {
    background-color: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
    padding: 12px 15px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

.wc-socios-message.wc-socios-error {
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
    padding: 12px 15px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

.wc-socios-message.wc-socios-info {
    background-color: #d1ecf1 !important;
    border: 1px solid #bee5eb !important;
    color: #0c5460 !important;
    padding: 12px 15px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

/* Mostrar mensaje permanente */
.wc-socios-permanent-message {
    padding: 1em;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    margin-bottom: 2em;
}
