/* Simple Web Scraper Plugin Styles */

.web-scraper-container {
    max-width: 1000px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-family: Arial, sans-serif;
}

/* Info Section */
.scraper-info {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.scraper-info h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

.scraper-info p {
    margin: 10px 0;
    color: #666;
    line-height: 1.5;
}

.scraper-info code {
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
}

/* Batch Processing Section */
.scraper-batch-section {
    margin-bottom: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.scraper-batch-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

#scraper-urls-list {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#scraper-urls-list:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

#scraper-batch-btn {
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#scraper-batch-btn:hover {
    background-color: #218838;
}

#scraper-batch-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Progress Section */
.scraper-progress-section {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.progress-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.progress-status {
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #0056b3 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
}

.progress-details {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.progress-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-item.success {
    color: #28a745;
    background-color: #f8fff9;
}

.progress-item.error {
    color: #dc3545;
    background-color: #fff8f8;
}

/* Summary Section */
.scraper-summary {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.scraper-summary h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid;
}

.stat-item.success {
    border-color: #28a745;
    background-color: #f8fff9;
}

.stat-item.error {
    border-color: #dc3545;
    background-color: #fff8f8;
}

.stat-item.total {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-item.success .stat-number {
    color: #28a745;
}

.stat-item.error .stat-number {
    color: #dc3545;
}

.stat-item.total .stat-number {
    color: #007cba;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scraper-input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#scraper-url-input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#scraper-url-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

#scraper-submit-btn {
    padding: 12px 24px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

#scraper-submit-btn:hover {
    background-color: #005a87;
}

#scraper-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.scraper-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.scraper-results {
    margin-top: 20px;
}

.scraper-section {
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.scraper-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.scraper-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.scraper-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.scraper-headings ul {
    list-style: none;
    padding: 0;
}

.scraper-headings li {
    margin-bottom: 8px;
    padding: 5px 0;
}

.scraper-headings .h1 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.scraper-headings .h2 {
    font-size: 16px;
    font-weight: bold;
    color: #555;
    margin-left: 20px;
}

.scraper-headings .h3 {
    font-size: 14px;
    font-weight: bold;
    color: #777;
    margin-left: 40px;
}

.scraper-links ul {
    list-style: none;
    padding: 0;
}

.scraper-links li {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.scraper-links a {
    color: #007cba;
    text-decoration: none;
    word-break: break-all;
}

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

.scraper-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.scraper-image-item {
    text-align: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.scraper-image-item img {
    max-width: 100%;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.scraper-image-alt {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    word-break: break-word;
}

.scraper-error {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #c62828;
    margin-top: 15px;
}

.scraper-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #2e7d32;
    margin-top: 15px;
}

.scraper-notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin-top: 15px;
}

.scraper-notice h3 {
    margin-top: 0;
    color: #856404;
}

.scraper-note {
    font-style: italic;
    color: #666;
    margin-bottom: 15px;
}

/* Company Directory Styles */
.scraper-companies {
    background-color: white;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.company-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.company-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.company-number {
    position: absolute;
    top: 10px;
    right: 15px;
    background-color: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.company-name {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
    padding-right: 40px; /* Space for number badge */
}

.company-city {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.company-website {
    margin-top: 15px;
}

.company-website a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.company-website a:hover {
    text-decoration: underline;
}

/* Empty state styling */
.scraper-companies ul {
    list-style-type: disc;
    margin-left: 20px;
}

.scraper-companies ul li {
    margin-bottom: 5px;
    color: #666;
}

/* Company URLs Display */
.company-urls-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.copy-urls-btn, .load-batch-btn, .export-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.copy-urls-btn {
    background-color: #6c757d;
    color: white;
}

.copy-urls-btn:hover {
    background-color: #5a6268;
}

.copy-urls-btn.copied {
    background-color: #28a745;
}

.load-batch-btn {
    background-color: #17a2b8;
    color: white;
}

.load-batch-btn:hover {
    background-color: #138496;
}

.export-btn {
    background-color: #ffc107;
    color: #212529;
}

.export-btn:hover {
    background-color: #e0a800;
}

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

.toggle-btn:hover {
    background-color: #5a6268;
}

.company-urls-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.company-url-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.company-url-item:last-child {
    border-bottom: none;
}

.company-url-item:hover {
    background-color: #f8f9fa;
}

.url-number {
    font-weight: bold;
    color: #666;
    min-width: 30px;
}

.company-url-item a {
    flex: 1;
    color: #007cba;
    text-decoration: none;
    word-break: break-all;
}

.company-url-item a:hover {
    text-decoration: underline;
}

.scrape-single-btn {
    padding: 6px 12px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.scrape-single-btn:hover {
    background-color: #005a87;
}

/* Single Company Display */
.single-company {
    max-width: 600px;
    margin: 0 auto;
}

.company-phone, .company-contact, .company-location, .company-email, .company-member-type {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.company-member-type {
    background-color: #f1f3f4;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    color: #333;
    font-weight: 500;
}

.company-contact strong {
    color: #333;
}

.company-email a {
    color: #007cba;
    text-decoration: none;
}

.company-email a:hover {
    text-decoration: underline;
}

.company-source {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.company-source small {
    color: #999;
}

.company-source a {
    color: #007cba;
    text-decoration: none;
}

.company-source a:hover {
    text-decoration: underline;
}

/* Sample URLs Section */
.sample-urls-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
}

.sample-urls-section h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.sample-urls {
    margin-bottom: 20px;
}

.sample-url-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.sample-url-item code {
    flex: 1;
    background-color: #f1f3f4;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 12px;
    word-break: break-all;
}

.manual-entry-section {
    border-top: 1px solid #ddd;
    padding-top: 20px;
    margin-top: 20px;
}

.manual-entry-section h4 {
    margin: 0 0 10px 0;
    color: #333;
}

#manual-urls-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#manual-urls-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

/* Batch Actions */
.batch-actions {
    margin-bottom: 20px;
}

/* Error List */
.scraper-errors {
    background-color: #fff5f5;
    border-left-color: #dc3545;
}

.error-list {
    list-style: none;
    padding: 0;
}

.error-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #721c24;
}

.error-list li:last-child {
    border-bottom: none;
}

/* Responsive design */
@media (max-width: 600px) {
    .scraper-input-section {
        flex-direction: column;
    }

    #scraper-url-input {
        min-width: auto;
        width: 100%;
    }

    #scraper-submit-btn {
        width: 100%;
    }

    .scraper-images {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .company-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .company-card {
        padding: 15px;
    }

    .company-name {
        font-size: 16px;
        padding-right: 35px;
    }

    .company-number {
        top: 8px;
        right: 10px;
        padding: 3px 6px;
        font-size: 11px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .batch-actions {
        flex-direction: column;
        gap: 10px;
    }

    .export-btn, .toggle-btn {
        width: 100%;
    }
}

@media (max-width: 768px) and (min-width: 601px) {
    .company-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
