/**
 * Advanced Mentions Feed Styles
 * REQ-2.x: Complete feed styling
 * ✅ OPTIMIZED: Bootstrap Grid + Responsive + Loading States
 */

/* ========================================
   LAYOUT - Bootstrap Grid Based
   ======================================== */
.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.feed-center-col {
    min-width: 0; /* Prevent grid blowout */
}

/* Mobile/Tablet: Stack vertically, sidebars not sticky */
/* ✅ FIX iPad: Usar breakpoint consistente 991.98px */
@media (max-width: 991.98px) {
    .sidebar-left,
    .sidebar-right {
        position: static;
        max-height: none;
    }
    
    .sidebar-left-col,
    .sidebar-right-col {
        order: 2; /* Feed first on mobile */
    }
    
    .feed-center-col {
        order: 1;
    }
}

/* ========================================
   FEED CENTER
   ======================================== */
.feed-header {
    position: sticky;
    top: 70px;
    z-index: 100;
}

.feed-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.feed-content {
    background: transparent;
}

.empty-feed {
    background: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feed-pagination {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

/* ========================================
   MENTION CARD
   ======================================== */
.mention-card-complete {
    background: white;
    border: 1px solid #e9ecef;
    border-left: 4px solid var(--theme-primary, #0a5fb3);
    border-radius: 8px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.mention-card-complete:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--theme-primary, #0a5fb3);
}

.mention-card-complete[data-is-read="true"] {
    opacity: 0.75;
    border-left-color: #6c757d;
}

.mention-card-complete[data-is-read="false"] {
    border-left-color: var(--theme-accent, #00c9ff);
    position: relative;
}

.mention-card-complete[data-is-read="false"]::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--theme-accent, #00c9ff);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--theme-accent, #00c9ff);
}

.mention-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.mention-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-primary, #0a5fb3);
    text-decoration: none;
    flex-grow: 1;
    margin-right: 1rem;
    line-height: 1.3;
}

.mention-card-title:hover {
    text-decoration: underline;
}

.mention-time {
    font-size: 0.7rem;
    white-space: nowrap;
}

.mention-text {
    margin-bottom: 0.75rem;
    color: #495057;
    line-height: 1.5;
    font-size: 0.85rem;
}

.mention-metadata {
    margin-bottom: 1rem;
}

.metadata-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.metadata-row:last-child {
    margin-bottom: 0;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
}

.metadata-item i {
    width: 12px;
    height: 12px;
}

.medio-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.medio-logo:hover {
    transform: scale(1.05);
}

/* Image placeholder styles */
.image-placeholder {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border: 1px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    line-height: 1;
}

.image-placeholder:hover {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    transform: scale(1.05);
}

.metadata-label {
    font-weight: 500;
}

/* Tier Badges */
.badge-tier-1,
.badge-tier-2,
.badge-tier-3 {
    font-size: 0.6rem !important;
    padding: 0.12rem 0.35rem !important;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.badge-tier-1 {
    background: #ffd700;
    color: #000;
}

.badge-tier-2 {
    background: #c0c0c0;
    color: #000;
}

.badge-tier-3 {
    background: #cd7f32;
    color: #fff;
}

.badge-tier-1 i,
.badge-tier-2 i,
.badge-tier-3 i {
    width: 10px;
    height: 10px;
}

/* Sentiment Badges */
.badge-sentiment-positivo,
.badge-sentiment-neutro,
.badge-sentiment-negativo {
    font-size: 0.6rem !important;
    padding: 0.12rem 0.35rem !important;
}

.badge-sentiment-positivo {
    background: #198754;
    color: white;
}

.badge-sentiment-neutro {
    background: #ffc107;
    color: #000;
}

.badge-sentiment-negativo {
    background: #dc3545;
    color: white;
}

/* Tipo de Medio Badge */
.badge-tipo-medio {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.12rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.badge-tipo-medio i {
    width: 10px;
    height: 10px;
    stroke-width: 2.5;
}

/* Indicador discreto de tipo de medio (pequeño círculo de color) */
.tipo-medio-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    cursor: help;
}

/* Fallback styles for missing data */
.metadata-item .text-muted {
    opacity: 0.7;
}

.metadata-item .badge:empty::after {
    content: "N/A";
    opacity: 0.6;
}

/* Better error states */
.mention-card-complete.error {
    border-left-color: #dc3545 !important;
    background-color: #fff5f5;
}

.mention-card-complete.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Actions */
.mention-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.btn-action {
    border: 1px solid #dee2e6;
    transition: all 0.2s;
}

.btn-action:hover {
    border-color: var(--theme-primary, #0a5fb3);
    color: var(--theme-primary, #0a5fb3);
}

.btn-action.active {
    background: var(--theme-primary, #0a5fb3);
    color: white;
    border-color: var(--theme-primary, #0a5fb3);
}

/* ========================================
   HIGHLIGHTED TEXT
   ======================================== */
.mention-text mark,
.mention-text .highlight {
    background-color: var(--theme-accent, #00c9ff);
    color: #000;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
}

/* ========================================
   TEMAS SIDEBAR
   ======================================== */
.temas-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.folder-chevron {
    transition: transform 0.2s;
}

.folder-header[aria-expanded="true"] .folder-chevron {
    transform: rotate(180deg);
}

/* ========================================
   FILTERS SIDEBAR
   ======================================== */
.advanced-filters {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

.filters-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.filters-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.filter-checkbox input {
    cursor: pointer;
}

.filter-checkbox:hover {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 4px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-separator {
    color: #6c757d;
}

/* ========================================
   SCROLLBAR CUSTOMIZATION
   ======================================== */
.temas-list::-webkit-scrollbar,
.filters-content::-webkit-scrollbar {
    width: 6px;
}

.temas-list::-webkit-scrollbar-track,
.filters-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.temas-list::-webkit-scrollbar-thumb,
.filters-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.temas-list::-webkit-scrollbar-thumb:hover,
.filters-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .mention-card-complete {
        padding: 1rem;
    }

    .metadata-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .mention-actions {
        flex-wrap: wrap;
    }
}

/* ========================================
   LOADING STATES
   ======================================== */
.feed-loading {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.loading-skeleton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.mention-card-skeleton {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes shimmer {
    to { transform: translateX(100%); }
}

/* ========================================
   BOOLEAN SEARCH BAR STYLES  
   ======================================== */
.boolean-search-bar {
    margin-bottom: 1rem;
}

.search-help code {
    background: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

/* ========================================
   MENTIONS ADVANCED LAYOUT (GRID BASED)
   ======================================== */
.mentions-advanced-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
}

/* ✅ FIX iPad: Usar mismo breakpoint que Bootstrap lg (992px) */
/* Antes: 1200px causaba gap donde sidebars ocultos pero botones también */
@media (max-width: 991.98px) {
    .mentions-advanced-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left,
    .sidebar-right {
        display: none; /* Mobile/Tablet: Show as modals/offcanvas */
    }
}

/* ========================================
   TEMAS SIDEBAR STYLES
   ======================================== */
.temas-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.temas-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tema-folder {
    margin-bottom: 0.5rem;
}

.folder-header {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.folder-header:hover {
    background: #e9ecef;
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.folder-content {
    padding-left: 1rem;
    padding-top: 0.5rem;
}

.tema-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.tema-item:hover {
    background: #f8f9fa;
    color: var(--theme-primary, #0a5fb3);
}

.tema-item.active {
    background: var(--theme-primary, #0a5fb3);
    color: white;
    font-weight: 600;
}

.tema-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.tema-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tema-logo:hover {
    transform: scale(1.05);
}

.tema-name {
    flex-grow: 1;
}

.tema-count {
    background: #e9ecef;
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
}

.tema-item.active .tema-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.unread-badge {
    background: #4466c0;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   SOCIAL MEDIA CARDS
   ======================================== */
.mention-card-social {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

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

/* Social Media Header */
.social-card-header {
    margin-bottom: 1rem;
}

.social-author-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.social-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.social-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.social-author-details {
    flex: 1;
    min-width: 0;
}

.social-author-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.social-author-name strong {
    font-size: 0.95rem;
    color: #1f2937;
}

.social-author-handle {
    font-size: 0.85rem;
    color: #6b7280;
}

.social-post-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.social-post-time i {
    width: 14px;
    height: 14px;
}

/* Social Media Content */
.social-card-content {
    margin-bottom: 1rem;
}

.social-post-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #374151;
    word-wrap: break-word;
}

.social-post-text p {
    margin-bottom: 0.5rem;
}

.social-post-text:last-child p:last-child {
    margin-bottom: 0;
}

/* Social Media Metrics */
.social-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}

.social-metric {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.social-metric i {
    width: 16px;
    height: 16px;
}

.social-metric span {
    font-weight: 500;
}

/* Platform-specific styles */
.mention-card-social[data-platform="facebook"] {
    border-left-color: #1877f2;
}

.mention-card-social[data-platform="facebook"] .social-card-metrics {
    border-top-color: rgba(24, 119, 242, 0.2);
}

.mention-card-social[data-platform="x"] {
    border-left-color: #000000;
}

.mention-card-social[data-platform="x"] .social-card-metrics {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.mention-card-social[data-platform="instagram"] {
    border-left-color: #e1306c;
}

.mention-card-social[data-platform="instagram"] .social-card-metrics {
    border-top-color: rgba(225, 48, 108, 0.2);
}

.mention-card-social[data-platform="tiktok"] {
    border-left-color: #ff0050;
}

.mention-card-social[data-platform="tiktok"] .social-card-metrics {
    border-top-color: rgba(255, 0, 80, 0.2);
}

.mention-card-social[data-platform="youtube"] {
    border-left-color: #ff0000;
}

.mention-card-social[data-platform="youtube"] .social-card-metrics {
    border-top-color: rgba(255, 0, 0, 0.2);
}

/* ========================================
   SOCIAL MEDIA EMBEDS (Nota Detail View)
   ======================================== */
.social-embed-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Facebook Embed */
.social-embed-container .fb-post {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Twitter/X Embed */
.social-embed-container .twitter-tweet {
    margin: 0 auto !important;
    max-width: 550px;
}

/* Instagram Embed */
.social-embed-container .instagram-media {
    margin: 0 auto !important;
    max-width: 540px;
    min-width: 326px;
}

/* TikTok Embed */
.social-embed-container .tiktok-embed {
    margin: 0 auto !important;
    max-width: 605px;
    min-width: 325px;
}

/* YouTube Embed */
.social-embed-container .ratio {
    max-width: 100%;
    margin: 0 auto;
}

.social-embed-container iframe {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Generic Embed */
.social-embed-generic {
    width: 100%;
    min-height: 400px;
}

.social-embed-generic iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: 8px;
}

/* Loading state para embeds - solo si no hay contenido */
.social-embed-container:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 400px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive para embeds */
@media (max-width: 767px) {
    .social-embed-container {
        padding: 1rem;
        min-height: 300px;
    }
    
    .social-embed-container .instagram-media,
    .social-embed-container .tiktok-embed {
        min-width: 100%;
        max-width: 100%;
    }
    
    .social-embed-container .ratio {
        aspect-ratio: 16 / 9;
    }
}

/* ========================================
   RESPONSIVE MOBILE / TABLET
   ✅ FIX iPad: Usar breakpoint consistente 991.98px
   ======================================== */

/* ✅ Por defecto ocultar botones móviles (se muestran en desktop con sidebars visibles) */
.mobile-toggle-buttons {
    display: none;
}

/* Tablets y móviles (menos de 992px = Bootstrap lg) */
@media (max-width: 991.98px) {
    /* Ocultar sidebars en tablet/móvil */
    .sidebar-left-col,
    .sidebar-right-col {
        display: none !important;
    }
    
    /* Feed ocupa todo el ancho */
    .feed-col,
    .feed-center-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* ✅ Mostrar botones toggle para móvil/tablet */
    .mobile-toggle-buttons {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Cuando los sidebars están visibles en offcanvas */
    .sidebar-left,
    .sidebar-right {
        max-height: 400px;
        overflow-y: auto;
    }
}

/* Móviles (menos de 768px) */
@media (max-width: 767px) {
    /* Menciones en lista más compacta */
    .mention-card {
        padding: 1rem;
    }
    
    .mention-title {
        font-size: 1rem;
    }
    
    .mention-metadata {
        font-size: 0.75rem;
    }
    
    /* Tabs más compactos */
    .media-type-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .badge-count {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Móviles muy pequeños (menos de 576px) */
@media (max-width: 576px) {
    .mention-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .mention-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .mention-excerpt {
        font-size: 0.8rem;
    }
    
    .media-type-tabs .nav-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    
    .mention-actions .btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* ========================================
   SOCIAL PLATFORM SUBTABS
   ======================================== */
.nav-pills-social {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-pills-social .nav-item {
    margin-bottom: 0.25rem;
}

.nav-pills-social .nav-link {
    color: #6c757d;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.nav-pills-social .nav-link:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.nav-pills-social .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.nav-pills-social .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.nav-pills-social .nav-link .badge {
    background: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Colores específicos por plataforma cuando está activa */
.nav-pills-social .nav-link[data-platform="Facebook"].active {
    background: linear-gradient(135deg, #1877f2 0%, #0d47a1 100%);
    border-color: #1877f2;
    color: white !important;
}

.nav-pills-social .nav-link[data-platform="X"].active,
.nav-pills-social .nav-link[data-platform="Twitter"].active {
    background: linear-gradient(135deg, #000000 0%, #1da1f2 100%);
    border-color: #000000;
    color: white !important;
}

.nav-pills-social .nav-link[data-platform="Instagram"].active {
    background: linear-gradient(135deg, #e4405f 0%, #833ab4 50%, #fcb045 100%);
    border-color: #e4405f;
    color: white !important;
}

.nav-pills-social .nav-link[data-platform="TikTok"].active {
    background: linear-gradient(135deg, #000000 0%, #ff0050 100%);
    border-color: #000000;
    color: white !important;
}

.nav-pills-social .nav-link[data-platform="YouTube"].active {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-color: #ff0000;
    color: white !important;
}

/* Asegurar que el texto y los iconos sean visibles cuando está activo */
.nav-pills-social .nav-link.active,
.nav-pills-social .nav-link.active i,
.nav-pills-social .nav-link.active span:not(.badge) {
    color: white !important;
}

@media (max-width: 768px) {
    .nav-pills-social {
        padding: 0.375rem;
    }
    
    .nav-pills-social .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* ========================================
   TEMAS TAGS - Para mostrar múltiples temas
   ✅ Cuando una nota pertenece a más de 1 tema
   ======================================== */
.temas-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed #e5e7eb;
}

.temas-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.tema-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tema-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tema-tag i {
    flex-shrink: 0;
}

/* Responsive: En móvil, los tags se apilan */
@media (max-width: 576px) {
    .temas-tags-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .tema-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ========================================
   ✅ TABS DESHABILITADOS (PRODUCTOS NO ACTIVOS)
   Estilos para tabs de menciones sin acceso
   ======================================== */

/* ✅ Tab deshabilitado - visual gris, no clickeable */
#mediaTypeTabs .nav-link.disabled,
#mediaTypeTabs .nav-link.producto-no-disponible {
    color: #adb5bd !important;
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.65;
    position: relative;
}

/* ✅ Badge dentro de tab deshabilitado */
#mediaTypeTabs .nav-link.disabled .badge,
#mediaTypeTabs .nav-link.producto-no-disponible .badge {
    background-color: #dee2e6 !important;
    color: #adb5bd !important;
}

/* ✅ Icono dentro de tab deshabilitado */
#mediaTypeTabs .nav-link.disabled i,
#mediaTypeTabs .nav-link.producto-no-disponible i {
    color: #adb5bd !important;
}

/* ✅ Hover disabled (visual feedback) */
#mediaTypeTabs .nav-link.disabled:hover,
#mediaTypeTabs .nav-link.producto-no-disponible:hover {
    color: #adb5bd !important;
    background-color: #f8f9fa !important;
}

/* ✅ Tooltip indicator para tabs deshabilitados */
#mediaTypeTabs .nav-link.producto-no-disponible::after {
    content: "No disponible en su plan";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

#mediaTypeTabs .nav-link.producto-no-disponible:hover::after {
    opacity: 1;
}

/* ✅ Indicador de candado para tabs sin acceso */
#mediaTypeTabs .nav-link.producto-no-disponible::before {
    content: "🔒";
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* ========================================
   ✅ DATE NAVIGATOR (Navegador día por día)
   Reemplaza el selector de rango de fechas
   ======================================== */
.date-navigator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-navigator .btn {
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.date-navigator .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.date-navigator .btn:not(:disabled):hover {
    background-color: var(--theme-primary, #0a5fb3);
    border-color: var(--theme-primary, #0a5fb3);
    color: white;
}

.date-navigator input[type="date"] {
    flex: 1;
    text-align: center;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.35rem 0.5rem;
}

.date-navigator input[type="date"]:focus {
    border-color: var(--theme-primary, #0a5fb3);
    box-shadow: 0 0 0 0.2rem rgba(10, 95, 179, 0.15);
    outline: none;
}

/* ========================================
   ✅ SORT CONTROLS (Controles de ordenamiento)
   Nueva sección arriba de los filtros
   ======================================== */
.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sort-controls .form-select {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

.sort-controls .btn-group {
    display: flex;
}

.sort-controls .btn-group .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0;
}

.sort-controls .btn-group .btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.sort-controls .btn-group .btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.sort-controls .btn-group .btn.active {
    background-color: var(--theme-primary, #0a5fb3);
    border-color: var(--theme-primary, #0a5fb3);
    color: white;
}

.sort-controls .btn-group .btn:not(.active):hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Responsive: En móvil los controles se ajustan */
@media (max-width: 576px) {
    .date-navigator {
        flex-wrap: nowrap;
    }
    
    .date-navigator input[type="date"] {
        font-size: 0.85rem;
    }
    
    .sort-controls .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
    }
}
/* ========================================
   REFRESH BUTTON ANIMATION
   ======================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animation {
    animation: spin 1s linear infinite;
}

#btnRefreshFeed {
    transition: all 0.2s ease;
}

#btnRefreshFeed:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
