/* Mentions Popup Styles */

.mentions-popup-page {
    border-radius: 12px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    overflow: hidden;
    margin: 0 auto;
    width: auto;
    position: relative;
}

.mentions-popup-page .popup-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    position: relative;
    background: var(--White, #FFF);
    border-radius: 12px;
    max-width: 600px !important;
    width: 95vw !important;
    padding: 24px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.dark .mentions-popup-page .popup-content {
    background: #27272A !important;
}

.mentions-popup-page .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    align-self: stretch;
    flex-shrink: 0;
}

.dark .mentions-popup-page .popup-header {
    border-bottom: none !important;
}

.mentions-popup-page .popup-header h3 {
    margin: 0;
    color: var(--Black, #000);
    font-family: Poppins;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; /* 133.333% */
}

.dark .mentions-popup-page .popup-header h3 {
    color: var(--White, #FFF);
}

.mentions-popup-page .close-popup {
    cursor: pointer;
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.mentions-popup-page .close-popup::before,
.mentions-popup-page .close-popup::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 1.5px;
    background: var(--Black, #000);
    transition: background 0.2s;
}

.dark .mentions-popup-page .close-popup::before,
.dark .mentions-popup-page .close-popup::after {
    background: var(--Neutral-Gray-1, #3F3F46) !important;
}

.mentions-popup-page .close-popup::before {
    transform: rotate(45deg);
}

.mentions-popup-page .close-popup::after {
    transform: rotate(-45deg);
}

.mentions-popup-page .close-popup:hover::before,
.mentions-popup-page .close-popup:hover::after {
    background: var(--blue, #0544FD);
}

.mentions-popup-page .content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    width: 100%;
    max-height: 70vh; /* Немного уменьшим, чтобы влезало в экран */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.mentions-popup-page .content-wrapper.limited-access {
    overflow-y: auto !important;
    max-height: 70vh;
}

.mentions-popup-page .content-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Metrics Container and Row */
.mentions-metrics-container {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.mentions-separator {
    height: 1px !important;
    align-self: stretch !important;
    background: #EBEBEB !important;
}

.dark .mentions-separator {
    background: var(--Neutral-Gray-1, #3F3F46) !important;
}

.mentions-metrics-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    align-self: stretch !important;
    padding: 16px 0 !important;
}

.mentions-metric-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    flex: 1 0 0 !important;
}

.mentions-metric-item:nth-child(2) {
    width: 197px !important;
    flex: 0 0 197px !important;
}

.mentions-metric-label {
    color: var(--Neutral-Gray-2, #656565) !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 20px !important;
}

.dark .mentions-metric-label {
    color: var(--Neutral-Gray-2, #656565) !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 20px !important;
}

.mentions-metric-value {
    color: var(--Black, #000) !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 700 !important;
    line-height: 20px !important;
}

.dark .mentions-metric-value {
    color: var(--White, #FFF) !important;
}

/* Tweets Container */
.mentions-tweets-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    width: 100%;
}

/* Tweet Card */
.mention-tweet-card {
    display: flex;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    align-self: stretch;
    border-radius: 8px;
    border: 1px solid var(--Neutral-Gray-7, #EBEBEB);
    background: var(--White, #FFF);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Blurred tweet cards now use .premium-blur-target--card from premium_blur.css */

.dark .mention-tweet-card {
    border: 1px solid var(--Neutral-Gray-1, #3F3F46);
    background: #27272A;
}

/* Tweet Author Row */
.tweet-author-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
}

.tweet-author-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex: 1;
}

.tweet-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.tweet-author-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.tweet-author-name-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.tweet-author-name {
    color: var(--Black, #000);
    font-family: Poppins;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 16px;
}

.dark .tweet-author-name {
    color: var(--White, #FFF);
}

.dark .tweet-author-score {
    color: var(--White, #FFF) !important;
}

.tweet-author-username {
    color: var(--Neutral-Gray-2, #656565);
    font-family: Poppins;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 14px;
}

.dark .tweet-author-username {
    color: var(--Neutral-Gray-2, #BABABA);
}

.tweet-author-score {
    color: var(--Primary, #0544FD) !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    background: transparent !important;
    padding: 0 !important;
    white-space: nowrap;
}

.tweet-header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.tweet-date {
    color: var(--Neutral-Gray-4, #9E9E9E) !important;
    text-align: right;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 16px !important;
    white-space: nowrap;
}

.tweet-origin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: opacity 0.2s;
    color: #818181;
}

.dark .tweet-origin-link {
    color: #BABABA;
}

.tweet-origin-link:hover {
    opacity: 0.7;
}

/* Tweet Text */
.tweet-text {
    color: var(--Black, #000);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 16px !important;
    word-wrap: break-word;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Ограничим 4 строками по просьбе "можно обрезать" */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .tweet-text {
    color: var(--White, #FFF) !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 16px !important;
}

.mention-link {
    color: #0544FD !important;
    text-decoration: none;
}

/* Tweet Footer and Stats */
.tweet-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
}

.tweet-stat-item {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    gap: 4px;
    color: #818181 !important;
    font-family: Poppins, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.dark .tweet-stat-item {
    color: var(--Neutral-Gray-3, #818181) !important;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.tweet-stat-item span {
    color: inherit !important;
}

.tweet-stat-item:hover {
    color: var(--blue, #0544FD) !important;
}

.tweet-stat-item svg {
    width: 16px !important;
    height: 16px !important;
    aspect-ratio: 1/1 !important;
    fill: currentColor !important;
}

/* Footer Mentions Auth/Upgrade */
.mentions-footer-auth {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 10;
    background: transparent;
    margin-top: 0;
}

/* Popup-specific auth card (bordered card in footer position) */
.mentions-popup-page .mentions-footer-auth .premium-blur-cta {
    border-radius: 8px;
    border: 1px solid var(--Neutral-Gray-7, #EBEBEB);
    background: var(--White, #FFF);
    padding: 12px;
    gap: 16px;
    width: 100%;
}

.dark .mentions-popup-page .mentions-footer-auth .premium-blur-cta {
    border: 1px solid var(--Neutral-Gray-1, #3F3F46);
    background: #27272A;
}

/* Title/subtitle styles now handled by .premium-blur-title/.premium-blur-subtitle in premium_blur.css */

/* No Mentions / Error Messages */
.no-mentions,
.error-message {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    color: var(--Neutral-Gray-2, #656565);
    font-family: Roboto;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
    text-align: center;
}

.error-message {
    color: #FC7005;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mentions-popup-page .popup-content {
        width: 95vw !important;
    }

    .mentions-metrics-row {
        flex-direction: column;
        gap: 12px;
    }

    .mentions-metric-item:nth-child(2) {
        width: 100%;
        flex: 1 0 0;
    }

    .mentions-popup-page .content-wrapper {
        max-height: 60vh;
    }

    .mentions-tweets-container {
        max-height: 40vh;
    }
}
