/**
 * ICP Lead Generator Plugin Styles
 * Version: 1.0.0
 */

/* Reset and Base Styles */
.icp-lead-generator-wrapper * {
    box-sizing: border-box;
}

.icp-lead-generator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 20px 0;
    width: 100%;
}

.icp-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Header */
.icp-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.icp-header h1 {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.icp-header p {
    opacity: 0.95;
    font-size: 16px;
    margin: 0;
}

/* Form Section */
.icp-form-section {
    padding: 40px;
}

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

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

.icp-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.icp-form-group input,
.icp-form-group select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

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

/* Advanced Filters */
.icp-toggle-advanced {
    background: none;
    border: none;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.icp-toggle-advanced:hover {
    color: #764ba2;
}

.icp-arrow {
    transition: transform 0.3s;
}

.icp-arrow.rotated {
    transform: rotate(90deg);
}

.icp-advanced-content {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.icp-advanced-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Buttons */
.icp-generate-btn,
.icp-download-btn,
.icp-new-search-btn {
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.icp-generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    max-width: 300px;
    margin: 30px auto 0;
    display: block;
}

.icp-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.icp-download-btn {
    background: #28a745;
    color: white;
}

.icp-download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.icp-new-search-btn {
    background: #6c757d;
    color: white;
    margin-left: 10px;
}

.icp-new-search-btn:hover {
    background: #5a6268;
}

/* Loading State */
.icp-loading {
    display: none;
    text-align: center;
    padding: 60px 40px;
}

.icp-loading.active {
    display: block;
}

.icp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: icp-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.icp-loading h3 {
    color: #333;
    margin-bottom: 10px;
}

.icp-loading p {
    color: #666;
    font-size: 14px;
}

/* Error Message */
.icp-error-message {
    display: none;
    background: #ff4444;
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.icp-error-message.active {
    display: block;
}

/* Results Section */
.icp-results-section {
    display: none;
    padding: 40px;
    background: #f8f9fa;
}

.icp-results-section.active {
    display: block;
}

.icp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.icp-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.icp-stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.icp-stat-label {
    color: #666;
    font-size: 14px;
}

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

.icp-results-header h2 {
    color: #333;
    margin: 0;
}

/* Table */
.icp-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.icp-results-table {
    width: 100%;
    border-collapse: collapse;
}

.icp-results-table th {
    background: #667eea;
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.icp-results-table td {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.icp-results-table tr:hover {
    background: #f8f9fa;
}

.icp-results-table tr:last-child td {
    border-bottom: none;
}

/* Dark Theme */
.icp-lead-generator-wrapper[data-theme="dark"] .icp-container {
    background: #1a1a1a;
    color: #e0e0e0;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-form-group label {
    color: #e0e0e0;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-form-group input,
.icp-lead-generator-wrapper[data-theme="dark"] .icp-form-group select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-results-section {
    background: #0a0a0a;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-stat-card,
.icp-lead-generator-wrapper[data-theme="dark"] .icp-table-container {
    background: #2a2a2a;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-results-table td {
    border-color: #444;
}

.icp-lead-generator-wrapper[data-theme="dark"] .icp-results-table tr:hover {
    background: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .icp-header h1 {
        font-size: 24px;
    }
    
    .icp-form-section,
    .icp-results-section {
        padding: 20px;
    }
    
    .icp-form-grid,
    .icp-advanced-content.active {
        grid-template-columns: 1fr;
    }
    
    .icp-results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .icp-results-header > div {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .icp-download-btn,
    .icp-new-search-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .icp-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .icp-table-container {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .icp-header {
        padding: 30px 20px;
    }
    
    .icp-stats {
        grid-template-columns: 1fr;
    }
    
    .icp-results-table th,
    .icp-results-table td {
        padding: 12px 8px;
        font-size: 12px;
    }
}

/* Animation Classes */
@keyframes icp-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.icp-fade-in {
    animation: icp-fade-in 0.5s ease-out;
}

/* Utility Classes */
.icp-hidden {
    display: none !important;
}

.icp-visible {
    display: block !important;
}

.icp-text-center {
    text-align: center;
}

.icp-mt-20 {
    margin-top: 20px;
}

.icp-mb-20 {
    margin-bottom: 20px;
}
