/*
 Theme Name:   Piwity
 Theme URI:    https://piwity.es
 Description:  Piwity theme.
 Author:       Piwity
 Author URI:   https://piwity.es
 Template:     Total
 Version:      1.0.1
 Text Domain:  piwity
*/

/* ============================================
   BUSCADOR AJAX DE EMPRESAS
   ============================================ */

/* Contenedor principal del buscador */
.pwt-buscador-empresas {
    max-width: 800px;
    margin: 20px auto;
}

/* Formulario de búsqueda */
.pwt-search-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Campos de búsqueda con autocompletado */
.pwt-search-field {
    flex: 1;
    position: relative;
}

.pwt-search-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.pwt-search-field input:focus {
    outline: none;
    border-color: #0073aa;
}

/* Botón de búsqueda */
.pwt-search-button {
    padding: 12px 30px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.pwt-search-button:hover {
    background: #005a8b;
}

/* ============================================
   DROPDOWN DE SUGERENCIAS
   ============================================ */

/* Contenedor de sugerencias */
.pwt-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

/* Items individuales de sugerencias */
.pwt-suggestion-item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f5f7fa;
    transition: all 0.2s ease;
    position: relative;
    font-size: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Iconos de las sugerencias */
.pwt-suggestion-item:before {
    content: "📍";
    font-size: 14px;
    opacity: 0.7;
}

.pwt-suggestion-item[data-type="profesion"]:before {
    content: "💼";
}

/* Estados hover y activo */
.pwt-suggestion-item:hover,
.pwt-suggestion-item.active {
    background: #f8f9fa;
    color: #2c3e50;
    transform: none;
    box-shadow: none;
    border-left: 3px solid #0073aa;
}

.pwt-suggestion-item:hover:before,
.pwt-suggestion-item.active:before {
    opacity: 1;
    transform: none;
}

/* Último y primer item */
.pwt-suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.pwt-suggestion-item:first-child {
    border-radius: 0;
}

/* ============================================
   ESTADOS ESPECIALES DEL DROPDOWN
   ============================================ */

/* Indicador de carga */
.pwt-suggestions.loading:after {
    content: "⏳ Buscando...";
    display: block;
    padding: 16px 18px;
    text-align: center;
    color: #64748b;
    font-style: italic;
    background: #f8fafc;
}

/* Sin resultados */
.pwt-suggestions.no-results:after {
    content: "❌ Sin resultados";
    display: block;
    padding: 16px 18px;
    text-align: center;
    color: #64748b;
    font-style: italic;
    background: #fef2f2;
}

/* ============================================
   SCROLLBAR PERSONALIZADA
   ============================================ */

.pwt-suggestions::-webkit-scrollbar {
    width: 6px;
}

.pwt-suggestions::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.pwt-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.pwt-suggestions::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .pwt-search-form {
        flex-direction: column;
    }
    
    .pwt-search-field,
    .pwt-search-button {
        width: 100%;
    }
}

/* ============================================
   EMPRESA BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-free {
    background-color: #6c757d;
    color: white;
}

.badge-premium {
    background-color: #0073aa;
    color: white;
}

.badge-winner {
    background-color: #d63031;
    color: white;
}

/* ============================================
   FILTROS DE EMPRESAS
   ============================================ */

.pwt-filtro-empresas {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    margin: 2rem 0;
}

.pwt-filtro-grupo {
    flex: 1 1 300px;
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pwt-filtro-grupo h2 {
    margin-bottom: 1rem;
    font-size: 1.1em;
    color: #222;
}

.pwt-radio {
    display: flex;
    align-items: center;
    margin: 6px 0;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
    font-size: 15px;
    user-select: none;
}

.pwt-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.pwt-radio span {
    position: relative;
    padding: 4px 6px;
    transition: all 0.2s ease;
}

.pwt-radio::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    border: 2px solid #bbb;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
}

.pwt-radio input:checked ~ span {
    color: #0073aa;
    font-weight: 600;
}

.pwt-radio input:checked ~ span::after {
    content: '';
    position: absolute;
    left: -22px;
    top: 6px;
    width: 10px;
    height: 10px;
    background: #0073aa;
    border-radius: 2px;
}

.pwt-radio:hover::before {
    border-color: #0073aa;
}

/* ============================================
   SISTEMA DE MEMBRESÍA - LOGIN, REGISTRO Y PLANES
   ============================================ */

/* Wrappers generales */
.pwt-login-wrapper,
.pwt-registro-wrapper,
.pwt-planes-wrapper {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pwt-planes-wrapper {
    max-width: 1200px;
}

/* Mensajes de éxito y error */
.pwt-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 14px;
}

.pwt-message.pwt-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.pwt-message.pwt-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Formularios */
.pwt-login-form,
.pwt-registro-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pwt-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pwt-form-field label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pwt-form-field input[type="text"],
.pwt-form-field input[type="email"],
.pwt-form-field input[type="password"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.pwt-form-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pwt-form-field small {
    color: #666;
    font-size: 12px;
}

/* Checkbox personalizado */
.pwt-form-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.pwt-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.pwt-form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.pwt-form-checkbox label a {
    color: #667eea;
    text-decoration: underline;
}

/* Botones */
.pwt-button {
    padding: 14px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.pwt-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pwt-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.pwt-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.pwt-button-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

/* Enlaces del formulario */
.pwt-form-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    text-align: center;
}

.pwt-form-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.pwt-form-links a:hover {
    text-decoration: underline;
}

/* ============================================
   PLANES DE SUSCRIPCIÓN
   ============================================ */

.pwt-planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.pwt-plan {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.pwt-plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.pwt-plan-destacado {
    border-color: #667eea;
    border-width: 3px;
}

.pwt-plan-badge {
    position: absolute;
    top: 20px;
    right: -35px;
    background: #667eea;
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pwt-plan-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    text-align: center;
}

.pwt-plan-premium .pwt-plan-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pwt-plan-header h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
}

.pwt-plan-precio {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.pwt-precio {
    font-size: 48px;
    font-weight: 700;
}

.pwt-periodo {
    font-size: 18px;
    opacity: 0.8;
}

.pwt-plan-body {
    padding: 30px;
}

.pwt-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.pwt-plan-features li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.pwt-plan-features li:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .pwt-login-wrapper,
    .pwt-registro-wrapper {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .pwt-planes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pwt-plan-badge {
        font-size: 10px;
        padding: 5px 35px;
    }
}

/* ============================================
   DASHBOARD - TAB SUSCRIPCIÓN
   ============================================ */

.pwt-subscription-wrapper {
    max-width: 900px;
}

.pwt-subscription-wrapper h2 {
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
}

/* Plan Actual Badge */
.pwt-current-plan {
    background: #fff;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pwt-plan-badge-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    color: white;
}

.pwt-plan-badge-header.pwt-free {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
}

.pwt-plan-badge-header.pwt-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pwt-plan-badge-icon {
    font-size: 48px;
}

.pwt-plan-badge-info h3 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.pwt-plan-price {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
}

.pwt-plan-expiration {
    padding: 15px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}

/* Características del Plan */
.pwt-plan-features-box {
    padding: 30px;
}

.pwt-plan-features-box h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.pwt-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pwt-features-list li {
    padding: 10px 0;
    font-size: 15px;
}

.pwt-feature-active {
    color: #28a745;
}

.pwt-feature-premium {
    color: #667eea;
    font-weight: 600;
}

.pwt-feature-inactive {
    color: #999;
}

/* Acciones de Suscripción */
.pwt-subscription-actions {
    margin-top: 30px;
}

.pwt-upgrade-box,
.pwt-manage-box {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pwt-upgrade-box h3,
.pwt-manage-box h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: #333;
}

.pwt-upgrade-box p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
}

/* Beneficios Premium */
.pwt-upgrade-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0 30px 0;
}

.pwt-benefit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pwt-benefit-icon {
    font-size: 24px;
}

.pwt-benefit-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Botones */
.pwt-btn-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s;
}

.pwt-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.pwt-manage-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pwt-btn-cancel {
    color: #dc3545;
    border-color: #dc3545;
}

.pwt-btn-cancel:hover {
    background: #dc3545;
    color: white;
}

.pwt-cancel-note {
    margin: 20px 0 0 0;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
}

.pwt-cancel-note small {
    color: #856404;
    line-height: 1.5;
}

/* Historial de Pagos */
.pwt-invoices-box {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pwt-invoices-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.pwt-invoices-box p {
    margin: 0;
}

.pwt-invoices-box a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.pwt-invoices-box a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .pwt-upgrade-benefits {
        grid-template-columns: 1fr;
    }
    
    .pwt-manage-actions {
        flex-direction: column;
    }
    
    .pwt-manage-actions .pwt-btn {
        width: 100%;
        text-align: center;
    }
}
