/* RocketReach Contact Finder Extended - Frontend Styles */

.rrcfe-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rrcfe-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.rrcfe-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.rrcfe-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

/* Tabs */
.rrcfe-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.rrcfe-tab-button {
    padding: 12px 20px;
    border: none;
    background: #e9ecef;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.rrcfe-tab-button:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.rrcfe-tab-button.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* Tab Content */
.rrcfe-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.rrcfe-tab-content.active {
    display: block;
}

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

/* Forms */
.rrcfe-search-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.rrcfe-search-form h3 {
    margin: 0 0 25px 0;
    color: #343a40;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.rrcfe-form-group {
    margin-bottom: 20px;
}

.rrcfe-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.rrcfe-form-group input,
.rrcfe-form-group select,
.rrcfe-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.rrcfe-form-group input:focus,
.rrcfe-form-group select:focus,
.rrcfe-form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.rrcfe-form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.rrcfe-form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

/* Buttons */
.rrcfe-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.rrcfe-btn-primary {
    background: #007bff;
    color: white;
}

.rrcfe-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.rrcfe-btn-secondary {
    background: #6c757d;
    color: white;
}

.rrcfe-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.rrcfe-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.rrcfe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading */
.rrcfe-loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
}

.rrcfe-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error Messages */
.rrcfe-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.rrcfe-error p {
    margin: 0;
    font-weight: 500;
}

/* Results */
.rrcfe-results {
    background: white;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rrcfe-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.rrcfe-results-header h3 {
    margin: 0;
    color: #343a40;
    font-size: 18px;
    font-weight: 600;
}

.rrcfe-results-actions {
    display: flex;
    gap: 10px;
}

.rrcfe-results-content {
    padding: 25px;
}

/* Person Cards */
.rrcfe-person-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.rrcfe-person-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.rrcfe-profile-pic {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.rrcfe-person-info h4 {
    margin: 0 0 5px 0;
    color: #343a40;
    font-size: 18px;
    font-weight: 600;
}

.rrcfe-person-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.rrcfe-contact-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.rrcfe-contact-item {
    margin-bottom: 10px;
    font-size: 14px;
}

.rrcfe-contact-item:last-child {
    margin-bottom: 0;
}

.rrcfe-confidence {
    color: #28a745;
    font-weight: 500;
    font-size: 12px;
}

/* Search Results */
.rrcfe-search-results {
    display: grid;
    gap: 15px;
}

.rrcfe-search-result-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
}

.rrcfe-search-result-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rrcfe-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rrcfe-result-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.rrcfe-result-info {
    flex: 1;
}

.rrcfe-result-info h5 {
    margin: 0 0 5px 0;
    color: #343a40;
    font-size: 16px;
    font-weight: 600;
}

.rrcfe-result-info p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
}

/* Company Results */
.rrcfe-company-results {
    display: grid;
    gap: 15px;
}

.rrcfe-company-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.rrcfe-company-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rrcfe-company-item h5 {
    margin: 0 0 15px 0;
    color: #343a40;
    font-size: 18px;
    font-weight: 600;
}

.rrcfe-company-item p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #495057;
}

.rrcfe-company-item p:last-child {
    margin-bottom: 0;
}

/* Company Details */
.rrcfe-company-details {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
}

.rrcfe-company-details h4 {
    margin: 0 0 20px 0;
    color: #343a40;
    font-size: 22px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.rrcfe-company-info p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #495057;
}

.rrcfe-company-info p:last-child {
    margin-bottom: 0;
}

/* Bulk Results */
.rrcfe-bulk-results {
    text-align: center;
    padding: 30px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
}

.rrcfe-bulk-results p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.rrcfe-bulk-results p:last-child {
    margin-bottom: 0;
}

/* Pagination */
.rrcfe-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.rrcfe-pagination button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.rrcfe-pagination button:hover {
    background: #e9ecef;
}

.rrcfe-pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.rrcfe-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rrcfe-container {
        padding: 15px;
        margin: 10px;
    }
    
    .rrcfe-tabs {
        flex-direction: column;
    }
    
    .rrcfe-tab-button {
        width: 100%;
        text-align: center;
    }
    
    .rrcfe-search-form {
        padding: 20px;
    }
    
    .rrcfe-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .rrcfe-results-actions {
        justify-content: center;
    }
    
    .rrcfe-person-header {
        flex-direction: column;
        text-align: center;
    }
    
    .rrcfe-profile-pic {
        margin: 0 0 15px 0;
    }
    
    .rrcfe-result-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .rrcfe-header h2 {
        font-size: 22px;
    }
    
    .rrcfe-header p {
        font-size: 14px;
    }
    
    .rrcfe-search-form {
        padding: 15px;
    }
    
    .rrcfe-results-content {
        padding: 15px;
    }
}


/* Indicatori Cache e API */
.rrcfe-cache-indicator {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #bee5eb;
    font-size: 14px;
    font-weight: 500;
}

.rrcfe-api-indicator {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
    font-weight: 500;
}

/* Miglioramenti per tab nascosti */
.rrcfe-tab-button[style*="display: none"] {
    display: none !important;
}

/* Stili per risultati migliorati */
.rrcfe-search-result-item {
    position: relative;
    transition: all 0.3s ease;
}

.rrcfe-search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.rrcfe-btn-small {
    min-width: 80px;
    white-space: nowrap;
}

/* Animazioni per caricamento */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rrcfe-person-card {
    animation: fadeInUp 0.5s ease;
}

.rrcfe-search-result-item {
    animation: fadeInUp 0.3s ease;
}

/* Responsive migliorato per indicatori */
@media (max-width: 768px) {
    .rrcfe-cache-indicator,
    .rrcfe-api-indicator {
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
    }
}


/* Supporto Mobile Migliorato */
.rrcfe-mobile {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.rrcfe-mobile .rrcfe-btn,
.rrcfe-mobile .rrcfe-tab-button {
    -webkit-appearance: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.rrcfe-touch-active {
    transform: scale(0.98);
    opacity: 0.8;
    transition: all 0.1s ease;
}

.rrcfe-mobile input,
.rrcfe-mobile textarea,
.rrcfe-mobile select {
    font-size: 16px !important; /* Previene zoom su iOS */
    -webkit-appearance: none;
    border-radius: 0;
}

.rrcfe-mobile .rrcfe-search-form {
    padding: 15px;
}

.rrcfe-mobile .rrcfe-form-group {
    margin-bottom: 20px;
}

.rrcfe-mobile .rrcfe-btn {
    min-height: 48px; /* Touch target size */
    font-size: 16px;
}

.rrcfe-mobile .rrcfe-tab-button {
    min-height: 44px; /* Touch target size */
    padding: 12px 16px;
}

/* Fix per problemi di layout mobile */
@media (max-width: 768px) {
    .rrcfe-container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        box-sizing: border-box;
    }
    
    .rrcfe-tabs {
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .rrcfe-search-result-item {
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .rrcfe-btn-small {
        min-width: 100px;
        padding: 8px 12px;
    }
}

/* Fix per problemi specifici iOS */
@supports (-webkit-touch-callout: none) {
    .rrcfe-mobile input {
        transform: translateZ(0);
    }
}


/* Fix specifici per problemi mobile */
@media (max-width: 768px) {
    /* Assicura che i tab nascosti rimangano nascosti */
    .rrcfe-tab-button[style*="display: none"],
    .rrcfe-tab-button[style*="display:none"] {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Assicura che solo il tab content attivo sia visibile */
    .rrcfe-tab-content {
        display: none !important;
    }
    
    .rrcfe-tab-content.active {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Forza la visualizzazione corretta del tab people-search */
    #people-search.active {
        display: block !important;
    }
    
    #company-search:not(.active),
    #company-lookup:not(.active),
    #bulk-lookup:not(.active) {
        display: none !important;
    }
}

/* Fix per WebKit mobile */
@supports (-webkit-appearance: none) {
    .rrcfe-mobile .rrcfe-tab-content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

