/* Backlink Sifter Pro WordPress Plugin Styles */

.bsp-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    min-height: 600px;
}

/* Header Styles */
.bsp-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 16px;
    margin-bottom: 32px;
}

.bsp-header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.bsp-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bsp-icon {
    width: 32px;
    height: 32px;
    color: #2563eb;
}

.bsp-main-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.bsp-version-badge {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: #6b7280;
}

.bsp-description {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

/* Main Content */
.bsp-main-content {
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.bsp-upload-section {
    margin-bottom: 32px;
}

.bsp-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    margin-bottom: 64px;
}

@media (max-width: 1024px) {
    .bsp-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Card Styles */
.bsp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.bsp-card-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bsp-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
}

.bsp-card-content {
    padding: 24px;
}

.bsp-file-icon,
.bsp-filter-icon {
    width: 24px;
    height: 24px;
    color: #059669;
}

.bsp-filter-icon {
    color: #7c3aed;
}

.bsp-note {
    font-size: 12px;
    color: #dc2626;
    margin-left: auto;
}

/* Button Styles */
.bsp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.bsp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bsp-btn-outline {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.bsp-btn-outline:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.bsp-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.bsp-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.bsp-btn-success {
    background: #059669;
    color: #ffffff;
}

.bsp-btn-success:hover:not(:disabled) {
    background: #047857;
}

.bsp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.bsp-btn-icon {
    width: 16px;
    height: 16px;
}

/* Input Styles */
.bsp-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
    transition: border-color 0.2s;
}

.bsp-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* File Upload */
.bsp-file-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 16px;
}

.bsp-file-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.bsp-file-status.success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.bsp-file-status.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Filter Styles */
.bsp-filter-group {
    margin-bottom: 24px;
}

.bsp-filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.bsp-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bsp-score-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bsp-score-inputs label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.bsp-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    background: #ffffff;
}

.bsp-tld-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bsp-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.bsp-checkbox-item:last-child {
    margin-bottom: 0;
}

.bsp-checkbox-item input[type="checkbox"] {
    margin: 0;
}

.bsp-checkbox-item label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-weight: normal;
}

.bsp-selected-count {
    margin-top: 8px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Results Styles */
.bsp-results-actions {
    display: flex;
    gap: 8px;
}

.bsp-results-info {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.bsp-category-stats {
    margin-bottom: 16px;
}

.bsp-category-stats h4 {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 8px 0;
}

.bsp-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bsp-category-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 4px;
    display: inline-block;
}

.bsp-category-badge.bsp-category-clickable:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bsp-no-data {
    text-align: center;
    padding: 64px 16px;
    color: #6b7280;
    font-size: 14px;
}

/* Table Styles */
.bsp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed; /* Fixed layout to prevent overflow */
}

.bsp-table th,
.bsp-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word; /* Better text wrapping */
}

.bsp-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.bsp-table td {
    color: #374151;
}

.bsp-table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    max-width: 100%; /* Ensure container doesn't exceed parent */
}

/* Column width adjustments */
.bsp-table th:nth-child(1), .bsp-table td:nth-child(1) { /* AS Score */
    width: 80px;
    min-width: 80px;
}

.bsp-table th:nth-child(2), .bsp-table td:nth-child(2) { /* Source URL */
    width: 40%;
    min-width: 200px;
}

.bsp-table th:nth-child(3), .bsp-table td:nth-child(3) { /* Category */
    width: 25%;
    min-width: 150px;
}

.bsp-table th:nth-child(4), .bsp-table td:nth-child(4) { /* TLD */
    width: 80px;
    min-width: 80px;
}

.bsp-table th:nth-child(5), .bsp-table td:nth-child(5) { /* Site Email */
    width: 120px;
    min-width: 120px;
}

.bsp-url-link {
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bsp-url-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.bsp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.bsp-badge-score-high {
    background: #d1fae5;
    color: #065f46;
}

.bsp-badge-score-medium {
    background: #fef3c7;
    color: #92400e;
}

.bsp-badge-score-low {
    background: #fee2e2;
    color: #991b1b;
}

.bsp-badge-secondary {
    background: #f3f4f6;
    color: #374151;
}

.bsp-badge-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.bsp-category-clickable:hover {
    background: #dbeafe;
    border-color: #2563eb;
    color: #1d4ed8;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.bsp-email-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bsp-email-btn {
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.bsp-email-btn:hover {
    background: #dbeafe;
    color: #2563eb;
}

.bsp-email-result {
    font-size: 11px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsp-email-result.success {
    color: #059669;
}

.bsp-email-result.error {
    color: #dc2626;
}

.bsp-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsp-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: bsp-spin 1s linear infinite;
}

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

/* Footer */
.bsp-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    margin-top: 64px;
}

.bsp-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bsp-header {
        padding: 16px;
    }
    
    .bsp-main-content {
        padding: 0 8px;
    }
    
    .bsp-card-header,
    .bsp-card-content {
        padding: 16px;
    }
    
    .bsp-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bsp-main-title {
        font-size: 20px;
    }
    
    .bsp-results-actions {
        flex-direction: column;
    }
    
    .bsp-score-inputs {
        grid-template-columns: 1fr;
    }
    
    .bsp-tld-grid {
        grid-template-columns: 1fr;
    }
}

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

.bsp-loading-overlay {
    position: relative;
}

.bsp-loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.bsp-loading-overlay.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: bsp-spin 1s linear infinite;
}

