/**
 * Hostmoon Prospector - Frontend CSS
 * Estilos específicos para o shortcode no frontend
 * @version 4.2.0
 */

/* Reset e Container Principal */
.hostmoon-prospector-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hostmoon-prospector-widget * {
    box-sizing: border-box;
}

/* Temas */
.hp-theme-light {
    background: #fff;
    color: #333;
}

.hp-theme-dark {
    background: #1e1e2f;
    color: #e0e0e0;
}

.hp-theme-dark .hp-form-group label {
    color: #b0b0b0;
}

.hp-theme-dark .hp-input,
.hp-theme-dark .hp-select {
    background: #2d2d44;
    border-color: #3d3d5c;
    color: #e0e0e0;
}

.hp-theme-dark .hp-card {
    background: #2d2d44;
    border-color: #3d3d5c;
}

/* Layout Compacto */
.hp-layout-compact .hp-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.hp-layout-compact .hp-header {
    padding: 15px;
}

/* Header */
.hp-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.hp-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.hp-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a2e;
}

.hp-theme-dark .hp-title {
    color: #fff;
}

.hp-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.hp-theme-dark .hp-subtitle {
    color: #a0a0a0;
}

/* Formulário */
.hp-form {
    margin-bottom: 30px;
}

.hp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.hp-form-group {
    display: flex;
    flex-direction: column;
}

.hp-form-group-half {
    grid-column: span 1;
}

.hp-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.hp-input,
.hp-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
}

.hp-input:focus,
.hp-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.hp-input::placeholder {
    color: #999;
}

.hp-help-text {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Select2 Customização */
.hostmoon-prospector-widget .select2-container {
    width: 100% !important;
}

.hostmoon-prospector-widget .select2-container--default .select2-selection--multiple,
.hostmoon-prospector-widget .select2-container--default .select2-selection--single {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-height: 44px;
    padding: 4px 8px;
}

.hostmoon-prospector-widget .select2-container--default .select2-selection--multiple:focus,
.hostmoon-prospector-widget .select2-container--default .select2-selection--single:focus,
.hostmoon-prospector-widget .select2-container--default.select2-container--focus .select2-selection--multiple,
.hostmoon-prospector-widget .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
    outline: none;
}

.hostmoon-prospector-widget .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #2271b1;
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 4px 8px;
    margin: 2px;
}

.hostmoon-prospector-widget .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 5px;
}

.hostmoon-prospector-widget .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff6b6b;
}

.hostmoon-prospector-widget .select2-dropdown {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hostmoon-prospector-widget .select2-results__option--highlighted[aria-selected] {
    background: #2271b1;
}

/* Botões */
.hp-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hp-btn-icon {
    font-size: 16px;
}

.hp-btn-primary {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
}

.hp-btn-primary:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4570 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.hp-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.hp-btn-secondary:hover {
    background: #e0e0e0;
}

.hp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Resultados */
.hp-results-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.hp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.hp-results-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}

.hp-theme-dark .hp-results-title {
    color: #fff;
}

.hp-results-info {
    background: #e7f3ff;
    color: #2271b1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hp-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Card de Empresa */
.hp-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.hp-card:hover {
    border-color: #2271b1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.hp-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.hp-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #1a1a2e;
    line-height: 1.3;
}

.hp-card-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.hp-card-body {
    padding: 20px;
}

.hp-card-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.hp-card-info-item {
    display: flex;
    flex-direction: column;
}

.hp-card-info-item.full-width {
    grid-column: 1 / -1;
}

.hp-card-info-label {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.hp-card-info-value {
    font-size: 13px;
    color: #333;
}

.hp-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.hp-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hp-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
}

.hp-badge-segmento {
    background: #e7f3ff;
    color: #2271b1;
}

.hp-badge-ativa {
    background: #d4edda;
    color: #155724;
}

.hp-badge-inativa {
    background: #f8d7da;
    color: #721c24;
}

.hp-card-actions {
    display: flex;
    gap: 8px;
}

.hp-btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

/* WhatsApp Link */
.hp-whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #25d366;
    text-decoration: none;
    font-weight: 500;
}

.hp-whatsapp-link:hover {
    color: #128c7e;
}

/* Loading */
.hp-loading {
    text-align: center;
    padding: 40px;
}

.hp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: hp-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes hp-spin {
    to { transform: rotate(360deg); }
}

.hp-loading p {
    color: #666;
    margin: 0;
}

/* Modal */
.hp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hp-modal.active {
    display: flex;
}

.hp-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.hp-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.hp-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

.hp-modal-close:hover {
    color: #d63638;
}

.hp-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Footer */
.hp-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
}

.hp-footer strong {
    color: #2271b1;
}

/* Empty State */
.hp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.hp-empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.hp-empty-state h4 {
    font-size: 18px;
    color: #666;
    margin: 0 0 10px 0;
}

.hp-empty-state p {
    margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .hostmoon-prospector-widget {
        padding: 20px;
    }

    .hp-title {
        font-size: 22px;
    }

    .hp-form-grid {
        grid-template-columns: 1fr;
    }

    .hp-form-actions {
        flex-direction: column;
    }

    .hp-btn {
        width: 100%;
    }

    .hp-results-list {
        grid-template-columns: 1fr;
    }

    .hp-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hp-card-info {
        grid-template-columns: 1fr;
    }

    .hp-card-footer {
        flex-direction: column;
    }
}

/* Animações */
@keyframes hp-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hp-card {
    animation: hp-fadeIn 0.3s ease;
}

/* Scrollbar customizada */
.hp-modal-body::-webkit-scrollbar {
    width: 8px;
}

.hp-modal-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.hp-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.hp-modal-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}
