﻿/* ========== SITE TOOLTIP MODERN STYLES ========== */

.site-tooltip-card {
    min-width: 340px;
    max-width: 380px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #f8fafc;
}

/* ========== HEADER STYLES ========== */
.tooltip-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    position: relative;
}

.tooltip-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(51, 65, 85, 0.9);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 1000;
}

    .tooltip-close-btn:hover {
        background: rgba(239, 68, 68, 0.2);
        border-color: rgba(239, 68, 68, 0.4);
        color: #fca5a5;
        transform: scale(1.05);
    }

.header-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 8px 25px -8px rgba(239, 68, 68, 0.4);
}

.header-content {
    flex: 1;
}

.site-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.2;
}

.site-id {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* ========== BODY STYLES ========== */
.tooltip-body {
    padding: 0;
}

/* ========== MODERN ACCORDION STYLES ========== */
.accordion-modern {
    border: none;
}

.accordion-item-modern {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
}

    .accordion-item-modern:last-child {
        border-bottom: none;
    }

.accordion-header-modern {
    padding: 0;
}

.accordion-btn-modern {
    background: transparent;
    border: none;
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

    .accordion-btn-modern:hover {
        background: rgba(51, 65, 85, 0.3);
        color: #ffffff;
    }

    .accordion-btn-modern:focus {
        outline: none;
        box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.3);
    }

    .accordion-btn-modern.collapsed .accordion-chevron {
        transform: rotate(0deg);
    }

    .accordion-btn-modern:not(.collapsed) .accordion-chevron {
        transform: rotate(180deg);
    }

.accordion-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3);
}

.rf-icon {
    background: linear-gradient(135deg, #10b981, #047857);
}

.survey-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.accordion-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    color: #94a3b8;
    font-size: 12px;
}

.accordion-content-modern {
    padding: 0 16px 20px 16px;
    background: rgba(30, 41, 59, 0.3);
}

.scrollable-content {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

    /* Custom scrollbar for better aesthetics */
    .scrollable-content::-webkit-scrollbar {
        width: 4px;
    }

    .scrollable-content::-webkit-scrollbar-track {
        background: rgba(100, 116, 139, 0.1);
        border-radius: 2px;
    }

    .scrollable-content::-webkit-scrollbar-thumb {
        background: rgba(100, 116, 139, 0.4);
        border-radius: 2px;
    }

        .scrollable-content::-webkit-scrollbar-thumb:hover {
            background: rgba(100, 116, 139, 0.6);
        }

.site-details-section {
    margin-top: 8px;
}

/* ========== INFO SECTIONS ========== */
.info-section {
    margin-bottom: 20px;
}

    .info-section:last-child {
        margin-bottom: 0;
    }

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

    .section-header i {
        color: #60a5fa;
        font-size: 14px;
    }

    .section-header span {
        font-size: 13px;
        font-weight: 600;
        color: #e2e8f0;
    }

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: between;
    align-items: center;
}

    .info-item .label {
        font-size: 12px;
        color: #94a3b8;
        font-weight: 500;
        flex-shrink: 0;
        min-width: 80px;
    }

    .info-item .value {
        font-size: 12px;
        color: #f1f5f9;
        font-weight: 500;
        margin-left: auto;
        text-align: right;
    }

/* ========== SECTION CONTENT STYLES ========== */
.section-content {
    min-height: 40px;
}

.loading-state, .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #94a3b8;
    font-size: 12px;
}

    .loading-state .spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(148, 163, 184, 0.3);
        border-top: 2px solid #94a3b8;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .empty-state i {
        font-size: 16px;
        color: #64748b;
    }

/* ========== DATA DISPLAY STYLES ========== */
.source-item, .pattern-group {
    background: rgba(51, 65, 85, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.source-item {
    border-left-color: #f59e0b;
}

.pattern-group {
    border-left-color: #06b6d4;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.item-title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    flex: 1;
}

.item-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.frequency-badge {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.item-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.pattern-badges {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.badge-h {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-v {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.total-summary {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .total-summary .label {
        font-size: 12px;
        color: #94a3b8;
    }

    .total-summary .badge {
        background: rgba(59, 130, 246, 0.3);
        color: #93c5fd;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
    }

/* ========== FOOTER STYLES ========== */
.tooltip-footer {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    padding: 16px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}

.details-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

    .details-btn:hover {
        background: linear-gradient(135deg, #2563eb, #1e40af);
        transform: translateY(-1px);
        box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.4);
    }

    .details-btn:active {
        transform: translateY(0);
    }

.site-name-tooltip {
    background: rgba(33, 37, 41, 0.95) !important;
    color: #f8f9fa !important;
    border: 1px solid #495057 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

    .site-name-tooltip::before {
        border-top-color: rgba(33, 37, 41, 0.95) !important;
    }

/* ========== ANIMATIONS ========== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-tooltip-card {
    animation: fadeInUp 0.3s ease;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    .site-tooltip-card {
        min-width: 300px;
        max-width: 320px;
    }

    .tooltip-header {
        padding: 14px;
    }

    .accordion-btn-modern {
        padding: 14px;
    }

    .accordion-content-modern {
        padding: 0 14px 16px 14px;
    }

    .tooltip-footer {
        padding: 14px;
    }
}