/* Component Styles */

/* Detail Section */
.detail-section {
    height: 100%;
    overflow-y: auto;
}

.detail-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.detail-header h2 {
    color: #007bff;
    margin-bottom: 5px;
}

.detail-group {
    margin-bottom: 20px;
}

.detail-group h3 {
    color: #333;
    margin-bottom: 10px;
}

.detail-item {
    margin-bottom: 8px;
}

.detail-label {
    font-weight: bold;
    color: #666;
    display: inline-block;
    width: 150px;
}

.detail-value {
    color: #333;
}

.no-selection {
    text-align: center;
    color: #666;
    margin-top: 50px;
}

/* Tags and Badges */
.employee-count {
    background-color: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
}

.activity-field {
    background-color: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 2px;
    display: inline-block;
}

.representatives {
    list-style-type: none;
}

.representatives li {
    background-color: #6c757d;
    color: white;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

.technology-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e9ecef;
    padding: 3px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 2px 3px 2px 0;
}

.technology-tag:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

.technology-tag.with-version {
    position: relative;
}

.technology-tag .technology-version {
    background: rgba(0,0,0,0.1);
    padding: 1px 4px;
    border-radius: 8px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    margin-left: 4px;
}

.technology-tag:hover .technology-version {
    background: rgba(255,255,255,0.3);
}

/* SEO Components */
.seo-score {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-left: 10px;
}

.seo-score.good {
    background-color: #0CCE6B;
    color: white;
}

.seo-score.needs-improvement {
    background-color: #FFA400;
    color: white;
}

.seo-score.poor {
    background-color: #FF5722;
    color: white;
}

.seo-details {
    margin-top: 10px;
    color: #666;
}

.seo-detail-item {
    margin: 3px 0;
}

.seo-check {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.seo-check.pass {
    background-color: #28a745;
}

.seo-check.fail {
    background-color: #dc3545;
}

/* Technology Section */
.tech-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tech-count {
    background-color: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
}

.tech-category {
    margin-bottom: 15px;
}

.tech-category-header {
    font-weight: bold;
    color: #495057;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e9ecef;
}

.tech-category-count {
    background-color: #e9ecef;
    color: #495057;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
}

/* Analysis Status */
.analysis-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
    display: inline-block;
}

.analysis-status.success {
    background-color: #d4edda;
    color: #155724;
}

.analysis-status.warning {
    background-color: #fff3cd;
    color: #856404;
}

.analysis-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.analysis-status.muted {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* Wappalyzer Detail Structure */
.wappalyzer-detail-structure {
    margin-top: 10px;
}

.detail-tech-group {
    margin-bottom: 25px;
}

.detail-group-header {
    color: #34495e;
    margin: 0 0 15px 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    font-weight: 600;
}

.detail-tech-category {
    margin-bottom: 20px;
    padding-left: 15px;
}

.detail-category-header {
    color: #5a6c7d;
    margin: 0 0 10px 0;
    padding: 6px 10px;
    background-color: #ecf0f1;
    border-radius: 3px;
    border-left: 3px solid #95a5a6;
    font-weight: 500;
}

.detail-tech-tags {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    gap: 10px;
    justify-content: start;
    margin-left: 10px;
}

.detail-technology-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 200px;
    box-sizing: border-box;
}

.detail-technology-tag:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-technology-tag.with-version {
    padding: 6px 10px;
}

.detail-technology-tag .tech-name {
    font-weight: 500;
    color: #333;
}

.detail-technology-tag .technology-version {
    font-weight: bold;
    color: #007bff;
    background: transparent;
    padding: 0;
    border-radius: 0;
    min-width: auto;
    text-align: right;
}

/* Lighthouse scores layout */
.lighthouse-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 16px;
    justify-items: center;
    padding: 0 16px;
    background: #f8f9fa;
    border-radius: 8px;
    max-width: 100%;
}

.lighthouse-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* Responsive adjustments for narrow panels */
@media (max-width: 400px) {
    .lighthouse-scores {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 320px) {
    .lighthouse-scores {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .lighthouse-score {
        gap: 4px;
    }
}

.score-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* Responsive label adjustments */
@media (max-width: 400px) {
    .score-label {
        font-size: 10px;
        letter-spacing: 0.3px;
        max-width: 60px;
    }
}

@media (max-width: 320px) {
    .score-label {
        font-size: 9px;
        letter-spacing: 0.2px;
        max-width: 50px;
    }
}

/* Lighthouse report accordion */
.lighthouse-report-section {
    margin-top: 16px;
    border-top: 1px solid #dee2e6;
}

.lighthouse-accordion {
    margin: 0;
}

.lighthouse-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s;
}

.lighthouse-accordion-header:hover {
    background: #e9ecef;
}

.lighthouse-accordion[open] .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-arrow {
    transition: transform 0.2s;
    font-size: 12px;
}

.lighthouse-accordion-content {
    padding: 0;
}

.lighthouse-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.lighthouse-iframe-container {
    position: relative;
    width: 100%;
    min-height: 600px;
}

.lighthouse-iframe-fallback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-background);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    min-height: 400px;
}

.fallback-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.fallback-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.fallback-content h4 {
    color: var(--text-color);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.fallback-content p {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Circular Score Progress Indicators */
.circular-score {
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.circular-score .progress-bar {
    transition: stroke-dashoffset 0.6s ease-in-out;
    stroke-linecap: round;
}

.circular-score.good .progress-bar {
    stroke: #0CCE6B;
}

.circular-score.needs-improvement .progress-bar {
    stroke: #FFA400;
}

.circular-score.poor .progress-bar {
    stroke: #FF5722;
}

.circular-score .circular-progress {
    grid-area: 1 / 1;
}

.circular-score .score-text {
    grid-area: 1 / 1;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    text-align: center;
    pointer-events: none;
}

.circular-score.no-score {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.circular-score.no-score .score-text {
    color: #6c757d;
}

.circular-score.error {
    background: #f8d7da;
    border: 2px solid #FF5722;
    border-radius: 50%;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
}

.circular-score.error .score-text {
    color: #FF5722;
    font-size: 14px;
}

.circular-score.pending {
    background: #fff3cd;
    border: 2px solid #FFA400;
    border-radius: 50%;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
}

.circular-score.pending .score-text {
    color: #8a5700;
    font-size: 12px;
}

/* Actions Dropdown in Search Bar */
.search-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-filter input {
    flex: 1;
}

.actions-dropdown {
    position: relative;
}

.actions-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

.actions-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.actions-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

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

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dropdown-item .item-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.dropdown-item .item-text {
    font-size: 14px;
    color: #495057;
}

.dropdown-item:hover .item-text {
    color: #007bff;
}

.dropdown-item.full-scan-item {
    background: linear-gradient(135deg, #f8f9ff, #e6f3ff);
    font-weight: 500;
}

.dropdown-item.full-scan-item:hover {
    background: linear-gradient(135deg, #e6f3ff, #cce7ff);
}

.dropdown-item.full-scan-item .item-text {
    color: #0056b3;
}

/* Bulk Progress */
.bulk-progress {
    margin-bottom: 15px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-info {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.progress-text {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

/* Progress Control Buttons */
.progress-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.progress-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 10px;
}

.progress-control-btn:active {
    transform: translateY(0);
}

.progress-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Pause button - Yellow */
.progress-control-btn:not(.stop-btn):not(#resumeBtn) {
    background: #ffc107;
    border-color: #e0a800;
    color: #495057;
}

.progress-control-btn:not(.stop-btn):not(#resumeBtn):hover {
    background: #e0a800;
    border-color: #c69500;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* Resume button - Green */
#resumeBtn {
    background: #28a745;
    border-color: #1e7e34;
    color: white;
}

#resumeBtn:hover {
    background: #218838;
    border-color: #1c7430;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Stop button - Red */
.progress-control-btn.stop-btn {
    background: #dc3545;
    border-color: #c82333;
    color: white;
}

.progress-control-btn.stop-btn:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.control-icon {
    font-size: 11px;
    line-height: 1;
}

/* Analytics Dashboard with Tabs */
.analytics-dashboard .accordion-header {
    cursor: pointer;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f8f9ff;
}

.tab-content {
    min-height: 200px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .actions-dropdown {
        align-self: flex-end;
    }

    .actions-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    .tab-navigation {
        flex-direction: column;
    }

    .tab-btn {
        text-align: left;
        border-bottom: 1px solid #dee2e6;
        border-right: 3px solid transparent;
    }

    .tab-btn.active {
        border-bottom-color: #dee2e6;
        border-right-color: #007bff;
    }
}

@media (max-width: 600px) {
    .actions-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .dropdown-item {
        padding: 8px 12px;
    }

    .dropdown-item .item-text {
        font-size: 12px;
    }
}

/* Mixed Filter Styles (for SEO columns) */
.mixed-filter {
    padding: 10px;
    min-width: 250px;
}

.categorical-options {
    margin-bottom: 15px;
}

.categorical-options h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.categorical-options .multiselect-option {
    margin-bottom: 4px;
}

.categorical-options .multiselect-option label {
    font-size: 13px;
    color: #495057;
}

.range-filter h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

/* Analysis Subsections */
.analysis-subsection {
    margin-bottom: 20px;
}

.analysis-subsection:last-child {
    margin-bottom: 0;
}

.analysis-subsection h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 6px;
}

.tech-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
