:root {
    --bg-color: #f3f4f6;
    /* Light Gray Background */
    --sidebar-bg: #ffffff;
    /* White Sidebar */
    --card-bg: #ffffff;
    --text-primary: #111827;
    /* Dark Gray/Black */
    --text-secondary: #6b7280;
    /* Medium Gray */
    --accent-color: #f97316;
    /* Orange 500 */
    --accent-hover: #ea580c;
    /* Orange 600 */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(249, 115, 22, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(249, 115, 22, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

html,
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Auth Pages */
.auth-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--accent-color);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

/* Dashboard Layout */
.app-container {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 100;
}

.logo-area {
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), #fb923c);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smoother transition */
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-color);
    /* Use orange text */
    background: #fff7ed;
    /* Light orange bg */
    transform: translateX(8px);
    /* Slide effect */
    box-shadow: var(--shadow-sm);
}

.nav-link.active {
    background: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateX(8px);
}

.nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e7ff;
}

.user-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.user-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

.logout-btn {
    margin-left: auto;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.25rem;
    transition: color 0.2s;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.logout-btn:hover {
    color: var(--danger-color);
    background: #fef2f2;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2.5rem 3rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.dashboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.search-bar {
    position: relative;
    width: 350px;
}

.search-bar input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: white;
    border: 1px solid transparent;
    border-radius: 1rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.search-bar input:focus {
    box-shadow: var(--shadow-md);
    outline: none;
}

.search-bar i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(229, 231, 235, 0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
    will-change: transform;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 24px -4px rgba(249, 115, 22, 0.15), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
    border-color: rgba(249, 115, 22, 0.25);
}

.stat-card:hover .stat-header i {
    color: var(--accent-color);
    transform: scale(1.2) rotate(-5deg);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.stat-header i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.stat-card:hover .stat-value {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card:hover .stat-trend {
    transform: translateX(4px);
}

.stat-trend {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.stat-header i {
    font-size: 1.25rem;
    opacity: 0.7;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.stat-trend {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    width: fit-content;
}

.trend-up {
    color: #059669;
    background: #ecfdf5;
}

.trend-down {
    color: #dc2626;
    background: #fef2f2;
}

.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    min-height: auto;
    border: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
    will-change: transform;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -6px rgba(249, 115, 22, 0.12), 0 6px 12px -4px rgba(0, 0, 0, 0.06);
    border-color: rgba(249, 115, 22, 0.2);
}

.chart-card:hover h3 {
    color: var(--accent-color);
}

.chart-card h3 {
    transition: color 0.3s ease;
}

.chart-card h3 {
    margin-bottom: 1.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Container Fix */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* Mentions List */
.mentions-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mention-item {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    display: flex;
    gap: 1.25rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mention-item:hover {
    background: #fff7ed;
    border-color: rgba(249, 115, 22, 0.2);
    transform: translateX(6px);
    box-shadow: 0 4px 12px -2px rgba(249, 115, 22, 0.1);
}

.mention-item:hover .platform-icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 4px 12px -2px rgba(249, 115, 22, 0.2);
}

.platform-icon {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.platform-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: white;
    box-shadow: var(--shadow-sm);
}

.platform-facebook {
    color: #1877f2;
}

.platform-twitter {
    color: #1da1f2;
}

.platform-tiktok {
    color: #000000;
}

.platform-instagram {
    color: #e1306c;
}

/* Simplified for light theme */

.mention-content h5 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-weight: 600;
}

.mention-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Entrance Animations */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart Loading Shimmer Animation */
@keyframes chartShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes chartReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.08);
    }
}

/* Chart shimmer placeholder */
.chart-container.loading::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg,
            rgba(249, 115, 22, 0.03) 25%,
            rgba(249, 115, 22, 0.08) 50%,
            rgba(249, 115, 22, 0.03) 75%);
    background-size: 200% 100%;
    animation: chartShimmer 1.5s ease-in-out infinite;
    z-index: 1;
}

/* Chart canvas reveal when loaded */
.chart-container.chart-loaded canvas {
    animation: chartReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Feed item stagger entrance */
@keyframes mentionSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mention-item.animate-in {
    animation: mentionSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stat value count-up pulse */
.stat-value.counting {
    animation: pulseGlow 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Base state for animated elements */
.dashboard-entrance .anim-element {
    opacity: 0;
}

/* Trigger animation state */
.dashboard-entrance.trigger-animation .anim-element {
    animation: fadeInSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Show immediately (for subsequent visits) */
.dashboard-entrance.show-immediately .anim-element {
    opacity: 1;
    transform: none;
}

/* Staggered delays for sequential animation */
.dashboard-entrance.trigger-animation .delay-1 {
    animation-delay: 0.1s;
}

.dashboard-entrance.trigger-animation .delay-2 {
    animation-delay: 0.2s;
}

.dashboard-entrance.trigger-animation .delay-3 {
    animation-delay: 0.3s;
}

.dashboard-entrance.trigger-animation .delay-4 {
    animation-delay: 0.4s;
}

.dashboard-entrance.trigger-animation .delay-5 {
    animation-delay: 0.5s;
}

.dashboard-entrance.trigger-animation .delay-6 {
    animation-delay: 0.6s;
}

/* Sidebar entrance animation */
.sidebar-entrance {
    animation: fadeIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        background: #ffffff;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10000;
        visibility: hidden;
    }

    .sidebar.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        display: flex !important;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* New Chart Layout */
.charts-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile Headers */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .dashboard-header {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        margin-top: 1rem;
        width: 100%;
    }

    /* Login Card - Reduce padding */
    .login-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
        margin: 1rem;
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }

    /* Improve touch targets - minimum 44x44px */
    .btn-primary,
    .form-control {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .nav-link {
        padding: 1rem 1.25rem;
        min-height: 44px;
    }

    /* Chart cards - reduce padding */
    .chart-card {
        padding: 1.5rem;
    }

    /* Stats cards - better mobile spacing */
    .stat-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    /* Dashboard header title */
    .dashboard-header h2 {
        font-size: 1.5rem;
    }

    /* Mention items - better wrapping */
    .mention-item {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .mention-content {
        flex: 1;
        min-width: 0;
    }

    .mention-content h5 {
        font-size: 0.95rem;
        overflow-wrap: break-word;
    }

    .mention-content p {
        font-size: 0.85rem;
        overflow-wrap: break-word;
    }
}

/* Extra small screens - additional optimizations */
@media (max-width: 480px) {

    /* Further reduce login card padding */
    .login-card {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    /* Main content padding */
    .main-content {
        padding: 1rem;
    }

    /* Dashboard header */
    .dashboard-header {
        margin-bottom: 1.5rem;
    }

    .dashboard-header h2 {
        font-size: 1.25rem;
    }

    /* Logo area in sidebar */
    .logo-area {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }

    /* Stats grid - more compact */
    .stats-grid {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-header {
        font-size: 0.85rem;
    }

    /* Charts section */
    .chart-card {
        padding: 1.25rem;
    }


    /* Tooltips */

    .chart-card h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }


    /* Platform icons - slightly smaller */
    .platform-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.2rem;
    }

    /* User profile in sidebar */
    .user-info h4 {
        font-size: 0.9rem;
    }

    .user-info span {
        font-size: 0.75rem;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    /* Search bar */
    .search-bar input {
        font-size: 0.95rem;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }

    .search-bar i {
        left: 1rem;
        font-size: 1rem;
    }

    /* Form controls */
    .form-control {
        font-size: 0.95rem;
        padding: 0.75rem 0.875rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    /* Buttons - ensure good touch targets */
    .btn-primary {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}



/* --- NEW: Advanced AI Strategic Intelligence Section --- */
.ai-strategic-section {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}

.section-header-ai {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.section-header-ai h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header-ai p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.strategic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.strategic-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(229, 231, 235, 0.6);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.strategic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.strategic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
}

.strategic-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.strategic-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.strategic-header i {
    color: #6366f1;
    font-size: 1.1rem;
}

.chart-container-sm {
    position: relative;
    height: 220px;
    width: 100%;
    margin-bottom: 1rem;
}

.strategic-insight-text {
    margin-top: auto;
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border-left: 3px solid #6366f1;
}

.strategic-insight-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Credibility Meter */
.credibility-meter-container {
    text-align: center;
    padding: 1rem 0;
}

.credibility-score {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.score-val {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-max {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 500;
}

.credibility-bar-bg {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.credibility-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #34d399, #10b981);
    border-radius: 6px;
    transition: width 1s ease-out;
}

.fact-check-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.fc-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.fc-item.verified {
    color: #059669;
}

.fc-item.disputed {
    color: #dc2626;
}

/* SWOT Grid */
.swot-container {
    margin-top: 3rem;
}

.swot-container h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.swot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
}

.swot-box {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all 0.2s;
}

.swot-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.swot-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Strengths (Green) */
.swot-box.strengths {
    border-top: 4px solid #10b981;
}

.swot-box.strengths .swot-icon {
    background: #ecfdf5;
    color: #047857;
}

.swot-box.strengths h4 {
    color: #047857;
}

/* Weaknesses (Red) */
.swot-box.weaknesses {
    border-top: 4px solid #ef4444;
}

.swot-box.weaknesses .swot-icon {
    background: #fef2f2;
    color: #b91c1c;
}

.swot-box.weaknesses h4 {
    color: #b91c1c;
}

/* Opportunities (Blue) */
.swot-box.opportunities {
    border-top: 4px solid #3b82f6;
}

.swot-box.opportunities .swot-icon {
    background: #eff6ff;
    color: #1d4ed8;
}

.swot-box.opportunities h4 {
    color: #1d4ed8;
}

/* Threats (Orange) */
.swot-box.threats {
    border-top: 4px solid #f59e0b;
}

.swot-box.threats .swot-icon {
    background: #fffbeb;
    color: #b45309;
}

.swot-box.threats h4 {
    color: #b45309;
}

.swot-box h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.swot-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.swot-box ul li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.swot-box ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: currentColor;
}

@media (max-width: 768px) {
    .swot-grid {
        grid-template-columns: 1fr;
    }

    .strategic-grid {
        grid-template-columns: 1fr;
    }
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    padding: 0.875rem 1.5rem;
    background: #ef4444;
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 10;
    overflow: hidden;
}

.dropdown-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

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

.dropdown-item.danger {
    color: #ef4444;
}

.dropdown-item.danger:hover {
    background: #fef2f2;
}

/* Page item wrapper for relative positioning */
.page-item-wrapper {
    position: relative;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        max-width: 95%;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-secondary,
    .btn-danger,
    .modal-footer .btn-primary {
        width: 100%;
    }
}

/* ===== POLITICIANS SECTION STYLES ===== */

/* Politicians Container */
.politicians-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.header-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header-info p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    white-space: nowrap;
}

/* Politicians Grid */
.politicians-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

/* Slider dots — hidden on desktop, shown on mobile via @media */
.ent-slider-indicator {
    display: none;
}

.politician-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.politician-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.politician-card .card-header {
    background: var(--accent-color);
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 140px;
}

/* Alternative simple header without photo overlap */
.politician-card .card-header-simple {
    background: white;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.politician-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    position: absolute;
    bottom: -40px;
}

.btn-edit-card {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    z-index: 5;
}

.btn-edit-card:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.btn-delete-card {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    z-index: 5;
}

.btn-delete-card:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.politician-card .card-body {
    padding: 2.75rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.politician-card .card-body h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
}

.politician-card .description {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.85rem;
    margin: 0;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-item i {
    color: var(--accent-color);
    font-size: 1rem;
}

.stat-item .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item .stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mini Sentiment Bar */
.mini-sentiment {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sentiment-bar {
    display: flex;
    height: 8px;
    border-radius: 1rem;
    overflow: hidden;
    background: #f3f4f6;
}

.sentiment-segment {
    transition: width 0.3s ease;
}

.sentiment-segment.positive {
    background: #10b981;
}

.sentiment-segment.neutral {
    background: #6b7280;
}

.sentiment-segment.negative {
    background: #ef4444;
}

.sentiment-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-item .dot.positive {
    background: #10b981;
}

.legend-item .dot.neutral {
    background: #6b7280;
}


/* Tooltips */
.tooltip-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #e5e7eb;
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    background-color: var(--accent-color);
    color: white;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Mobile responsive adjustments for tooltips */
@media (max-width: 480px) {
    .tooltip-text {
        width: 180px;
        /* Adjust positioning to keep it on screen if needed */
    }
}

/* Emotion Badge */
.emotion-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    color: #92400e;
}

.emotion-badge-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.emotion-badge i,
.emotion-badge-simple i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* Card Footer */
.politician-card .card-footer {
    padding: 1rem 2rem;
    background: #f9fafb;
    border-top: 1px solid var(--border-color);
}

.view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: gap 0.2s;
}

.politician-card:hover .view-details {
    gap: 0.75rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Modal Specific Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.modal.active {
    display: block;
}

.modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(4px);
}

.modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal .form-group input,
.modal .form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal .form-group input:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.modal .form-group small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ===== POLITICIAN INSIGHTS PAGE ===== */

.politician-insights-container {
    max-width: 1400px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-color);
}

/* Profile Section */
.profile-section {
    margin-bottom: 2.5rem;
}

.profile-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #e0e7ff;
    box-shadow: var(--shadow-md);
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-info .role {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.profile-stat i {
    color: var(--accent-color);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1.25rem;
    transition: all 0.3s;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-content h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-content .metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-content .metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Keywords Section */
.keywords-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.keywords-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.keywords-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.keyword-badge {
    padding: 1.25rem 2rem;
    border-radius: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
}

.keyword-badge:hover {
    transform: scale(1.05);
}

.keyword-badge.badge-1 {
    background: #667eea;
    color: white;
}

.keyword-badge.badge-2 {
    background: #f5576c;
    color: white;
}

.keyword-badge.badge-3 {
    background: #00f2fe;
    color: white;
}

/* AI Entity Insights Section */
.ai-entity-insights {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.entity-insight-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.insight-icon-large {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3);
}

.entity-insight-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.entity-insight-header h3 i {
    color: var(--accent-color);
}

.insight-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.entity-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.entity-insight-card {
    background: #f9fafb;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    gap: 1.25rem;
}

.entity-insight-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.entity-insight-card.main-insight {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff5eb 0%, #fffbf5 100%);
    border: 2px solid var(--accent-color);
}

.entity-insight-card.recommendation-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0fdf4 0%, #f7fef9 100%);
    border: 2px solid #10b981;
}

.insight-card-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.recommendation-card .insight-card-icon {
    color: #10b981;
}

.insight-card-content {
    flex: 1;
}

.insight-card-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.insight-card-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.insight-card-content p strong {
    color: var(--accent-color);
    font-weight: 700;
}

.ai-recommendations {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-recommendations li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.ai-recommendations li i {
    color: #10b981;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.chart-card.wide {
    grid-column: 1 / -1;
}

.chart-card.wide .chart-container {
    height: 350px;
    position: relative;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-header i {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.wide {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .politicians-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem !important;
        padding: 0.5rem 1rem 1rem 1rem !important;
        scrollbar-width: none;
    }

    .politicians-grid::-webkit-scrollbar {
        display: none;
    }

    .profile-card {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .keywords-container {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* ===== MODERNIZED ENTITY INSIGHTS ===== */

/* Profile Enhancements */
.modern-profile {
    flex-wrap: wrap;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    min-width: 300px;
}

.profile-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-badge.emotion-bg {
    background: #fef3c7;
    color: #92400e;
}

.profile-badge.attack-bg {
    background: #fef2f2;
    color: #b91c1c;
}

/* Section Title */
.insights-section-title {
    margin: 2.5rem 0 1.5rem;
    position: relative;
}

.insights-section-title .section-title-accent {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #fb923c);
    border-radius: 2px;
    margin-bottom: 0.75rem;
}

.insights-section-title h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-section-title h3 i {
    color: var(--accent-color);
}

.insights-section-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Modern Chart Cards */
.chart-card.modern-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0;
    transition: all 0.3s ease;
}

.chart-card.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.chart-card-accent {
    height: 4px;
    width: 100%;
}

.chart-header.modern-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 0;
    margin-bottom: 1rem;
}

.chart-icon-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.chart-header.modern-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.chart-card.modern-card .chart-container {
    padding: 0 1.5rem 1.5rem;
}

.chart-card.modern-card.wide .chart-container {
    height: 320px;
    position: relative;
}

/* Gauge Container */
.gauge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 220px;
}

/* AI CTA Banner */
.ai-cta-banner {
    margin-top: 3rem;
    position: relative;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4338ca 60%, #6366f1 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem 3rem;
    overflow: hidden;
    box-shadow: 0 20px 40px -8px rgba(99, 102, 241, 0.35);
}

.ai-cta-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.3) 0%, transparent 70%);
    pointer-events: none;
    animation: ctaGlowPulse 4s ease-in-out infinite;
}

@keyframes ctaGlowPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.ai-cta-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.ai-cta-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-cta-text {
    flex: 1;
}

.ai-cta-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.4rem;
}

.ai-cta-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
}

.ai-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #4338ca;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ai-cta-button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.ai-cta-button i {
    transition: transform 0.3s ease;
}

.ai-cta-button:hover i {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .ai-cta-content {
        flex-direction: column;
        text-align: center;
    }

    .ai-cta-banner {
        padding: 2rem 1.5rem;
    }

    .ai-cta-button {
        width: 100%;
        justify-content: center;
    }

    .profile-left {
        flex-direction: column;
        text-align: center;
    }

    .profile-badges {
        justify-content: center;
    }

    .chart-card.modern-card.wide .chart-container {
        height: 250px;
    }
}

/* ===== MODE TOGGLE BAR ===== */
.mode-toggle-bar {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.25rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.mode-toggle-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mode-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    user-select: none;
}

.mode-label-active {
    color: var(--accent-color);
}

.mode-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-color);
    transition: 0.3s ease;
    border-radius: 28px;
}

.mode-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mode-switch input:checked+.mode-slider {
    background: #8b5cf6;
}

.mode-switch input:checked+.mode-slider::before {
    transform: translateX(24px);
}

.mode-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.mode-badge-real {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.mode-badge-demo {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
    animation: demoPulse 2s ease-in-out infinite;
}

@keyframes demoPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .mode-toggle-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.75rem;
    }

    .mode-toggle-inner {
        justify-content: center;
    }

    .mode-badge {
        text-align: center;
        justify-content: center;
        font-size: 0.75rem;
    }
}

/* ===== NEW ENTIDADES FEATURES ===== */

/* Huge Add Button Section */
/* Huge Add Button Section - Compacted */
.hero-add-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.btn-add-huge {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-add-huge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(249, 115, 22, 0.3);
    background: var(--accent-hover);
}

.btn-add-huge i {
    font-size: 1.1rem;
}

.hero-subtitle {
    margin: 0;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex: 1;
}

@media (max-width: 768px) {
    .hero-add-section {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .hero-subtitle {
        text-align: center;
    }
}

/* AI Insights Text Section */
.ai-insights-text {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
    align-items: start;
}

.insight-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
}

.insight-content {
    flex: 1;
}

.insight-content h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.insight-content h4 i {
    color: var(--accent-color);
}

.insight-highlight {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 1.25rem 0;
}

.insight-highlight strong {
    color: var(--accent-color);
    font-weight: 700;
}

.ai-micro-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.micro-insight {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.micro-insight i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* Comparative Analytics Section */
.comparative-analytics {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.comparative-analytics h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.comparative-analytics h3 i {
    color: var(--accent-color);
}

.comparison-charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.comparison-rankings-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.comparison-doughnut-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.comparison-card {
    background: #f9fafb;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.comparison-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.comparison-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comparison-header i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.comparison-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Ranking Lists */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.ranking-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.rank-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-color);
    min-width: 35px;
}

.rank-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.rank-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 60px;
    text-align: right;
}

.rank-value.negative {
    color: var(--danger-color);
}

/* Entities Section */
.entities-section {
    margin-bottom: 2rem;
}

.entities-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.entities-section h3 i {
    color: var(--accent-color);
}

/* Update politician photo for simple header */
.card-header-simple .politician-photo {
    position: static;
    width: 100px;
    height: 100px;
    border: 3px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .comparison-rankings-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .btn-add-huge {
        padding: 1.5rem 2.5rem;
        font-size: 1.35rem;
    }

    .btn-add-huge i {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .ai-insights-text {
        flex-direction: column;
        padding: 1.5rem;
    }

    .insight-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .insight-content h4 {
        font-size: 1.1rem;
    }

    .insight-highlight {
        font-size: 0.95rem;
    }

    .comparative-analytics {
        padding: 1.5rem;
    }

    .comparative-analytics h3 {
        font-size: 1.35rem;
    }

    .comparison-card {
        padding: 1.25rem;
    }

    .ranking-item {
        padding: 0.75rem;
    }

    .rank-avatar {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .btn-add-huge {
        padding: 1.25rem 2rem;
        font-size: 1.15rem;
        width: 100%;
    }

    .hero-add-section {
        padding: 2rem 1rem;
    }
}

/* HTMX Configuration & Progress Bar */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1
}

.htmx-request.htmx-indicator {
    opacity: 1
}

/* HTMX Progress Bar */
.htmx-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent-color);
    z-index: 9999;
    transition: width 0.3s ease-out;
}

/* ===== MOBILE OPTIMIZATIONS (Post-Cascade overrides) ===== */
@media (max-width: 768px) {

    /* Prevent horizontal overflow */
    .app-container,
    body {
        overflow-x: hidden;
    }

    /* Entidades Hero Override */
    .hero-add-section {
        padding: 2rem 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .btn-add-huge {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1.1rem;
        white-space: normal;
        /* Allow wrapping if needed */
        height: auto;
    }

    /* AI Insights Stack */
    .ai-insights-text {
        flex-direction: column !important;
        padding: 1.5rem !important;
        gap: 1.5rem;
    }

    .politicians-grid {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch;
        gap: 1rem !important;
        padding: 0.5rem 1rem 1rem 1rem !important;
        scrollbar-width: none;
    }

    .politicians-grid::-webkit-scrollbar {
        display: none;
    }

    .comparison-charts-row,
    .comparison-rankings-row {
        grid-template-columns: 1fr !important;
        min-width: 0 !important;
    }

    .comparison-doughnut-row {
        grid-template-columns: 1fr !important;
    }

    /* Ensure comparison cards don't force width */
    .comparison-card {
        min-width: 0 !important;
        width: 100% !important;
    }

    .politician-card {
        min-width: calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        width: calc(100% - 2rem) !important;
        flex-shrink: 0 !important;
        scroll-snap-align: center;
    }

    /* Slider scroll indicator */
    .ent-slider-indicator {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 0.5rem;
    }

    .ent-slider-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #d1d5db;
        transition: all 0.3s;
        cursor: pointer;
    }

    .ent-slider-dot.active {
        background: linear-gradient(135deg, #f97316, #f59e0b);
        width: 24px;
        border-radius: 4px;
    }

    /* Progress bar alternative */
    .ent-slider-progress {
        height: 4px;
        background: #e5e7eb;
        border-radius: 2px;
        margin-top: 0.75rem;
        overflow: hidden;
    }

    .ent-slider-progress__bar {
        height: 100%;
        background: linear-gradient(90deg, #f97316, #f59e0b);
        border-radius: 2px;
        transition: width 0.3s;
    }

    /* Search Bar Override */
    .search-bar {
        width: 100% !important;
        max-width: 100%;
    }
}

/* ===== MOBILE OPTIMIZATIONS: MENCIONES & MONITORING ===== */
@media (max-width: 768px) {

    /* --- Menciones Page --- */
    .filters-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .menciones-container {
        padding: 1rem !important;
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .search-filter,
    .filter-groups {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    .filter-groups {
        flex-direction: column !important;
    }

    .filter-groups .form-control,
    .filter-groups .btn-primary {
        width: 100% !important;
        min-width: 0 !important;
    }

    .mention-item {
        flex-direction: column !important;
        gap: 1rem !important;
    }

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

    /* --- Attack Monitoring Page --- */
    .monitoring-container {
        padding: 1rem !important;
        overflow-x: hidden !important;
    }

    .monitoring-header-row {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
        align-items: center !important;
    }

    .threat-metrics-grid {
        grid-template-columns: 1fr !important;
        /* Stack metrics vertically or 2 cols */
    }

    /* Force 2 columns for metrics on slightly larger mobile if possible, but safe 1fr is better */
    /* Let's stick to 1fr to guarantee no overflow, or repeat(auto-fit, minmax(140px, 1fr)) */
    /* Using 1fr for safety on very small screens */

    .ai-insights-section,
    .charts-section,
    .info-section {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .geo-item {
        grid-template-columns: 80px 1fr 30px !important;
        /* Adjust for small width */
        gap: 5px !important;
    }

    .activity-item {
        grid-template-columns: 60px 1fr 10px !important;
    }

    .monitoring-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        /* Allow 2 cols here as metrics are small */
    }
}

/* Ensure main content doesn't have sidebar margin on mobile */
@media (max-width: 768px) {

    .main-content,
    .app-container {
        margin-left: 0 !important;
        padding-left: 1rem !important;
        /* Ensure slight padding */
        padding-right: 1rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        /* Prevent overflow */
        box-sizing: border-box !important;
    }
}

/* ===== MOBILE OPTIMIZATIONS: AUDIENCIA ===== */
@media (max-width: 768px) {

    /* Stack Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Stack Charts Row */
    .charts-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Stack Dashboard Custom Grid */
    .dashboard-grid-custom {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Ensure Chart Containers Resize */
    .chart-container {
        width: 100% !important;
        max-width: 100%;
        height: auto !important;
        min-height: 250px;
        /* Ensure visibility */
        margin: 0 auto;
        padding: 0;
    }

    /* Fix specific chart sizing if needed */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Highlight Card Adjustments */
    .highlight-card {
        margin-top: 1rem;
    }
}

/* Modal Tabs */
.modal-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

/* Empty Chart State */
.empty-chart-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    background: #f9fafb;
    border-radius: var(--radius-lg);
}

.empty-chart-message i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════
   Page Transition Animation (Sidebar Navigation)
   ═══════════════════════════════════════════════ */

@keyframes pageTransitionIn {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.99);
        filter: blur(4px);
    }

    60% {
        opacity: 1;
        filter: blur(0px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes pageTransitionOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.99);
        filter: blur(3px);
    }
}

/* Staggered children entrance */
@keyframes childStaggerIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Exit state — applied before swap */
.page-transition-exit {
    animation: pageTransitionOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* Enter state — applied after swap */
.page-transition-enter {
    animation: pageTransitionIn 0.35s cubic-bezier(0.0, 0.0, 0.2, 1) forwards;
}

/* Stagger children: stat-cards, chart-cards, etc. */
.page-transition-enter .stat-card,
.page-transition-enter .chart-card,
.page-transition-enter .mention-item,
.page-transition-enter .threat-card,
.page-transition-enter .source-card,
.page-transition-enter .politician-card,
.page-transition-enter .entity-card {
    opacity: 0;
    animation: childStaggerIn 0.4s cubic-bezier(0.0, 0.0, 0.2, 1) forwards;
}

.page-transition-enter .stat-card:nth-child(1),
.page-transition-enter .chart-card:nth-child(1),
.page-transition-enter .threat-card:nth-child(1),
.page-transition-enter .source-card:nth-child(1) {
    animation-delay: 0.06s;
}

.page-transition-enter .stat-card:nth-child(2),
.page-transition-enter .chart-card:nth-child(2),
.page-transition-enter .threat-card:nth-child(2),
.page-transition-enter .source-card:nth-child(2) {
    animation-delay: 0.12s;
}

.page-transition-enter .stat-card:nth-child(3),
.page-transition-enter .chart-card:nth-child(3),
.page-transition-enter .threat-card:nth-child(3),
.page-transition-enter .source-card:nth-child(3) {
    animation-delay: 0.18s;
}

.page-transition-enter .stat-card:nth-child(4),
.page-transition-enter .chart-card:nth-child(4),
.page-transition-enter .threat-card:nth-child(4),
.page-transition-enter .source-card:nth-child(4) {
    animation-delay: 0.24s;
}

.page-transition-enter .stat-card:nth-child(n+5),
.page-transition-enter .chart-card:nth-child(n+5),
.page-transition-enter .threat-card:nth-child(n+5),
.page-transition-enter .source-card:nth-child(n+5) {
    animation-delay: 0.3s;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .page-transition-enter,
    .page-transition-exit,
    .page-transition-enter .stat-card,
    .page-transition-enter .chart-card,
    .page-transition-enter .mention-item,
    .page-transition-enter .threat-card,
    .page-transition-enter .source-card,
    .page-transition-enter .politician-card,
    .page-transition-enter .entity-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* ═══════════════════════════════════════════════════════
   Post Detail — Premium Layout v2
   ═══════════════════════════════════════════════════════ */

/* ── Container ── */
.pd-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Entrance Animation (staggered) ── */
@keyframes pdFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pdFadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pdFadeSlideRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pdPopIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }

    70% {
        transform: scale(1.03);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pdKwPop {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

    100% {
        background-position: 200% 0;
    }
}

.pd-nav {
    animation: pdFadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--delay, 0) * 0.07s);
    margin-bottom: 1.25rem;
}



/* ── Back Button ── */
.pd-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font-family);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pd-back-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), #f97316);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transform: translateX(-3px);
}

.pd-back-btn:hover i {
    transform: translateX(-2px);
    transition: transform 0.2s;
}

/* ── Main Card ── */
.pd-card {
    background: var(--card-bg);
    border-radius: 1.25rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.6);
    overflow: hidden;
    position: relative;
    animation: pdFadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Top Section: Post Content (full width) ── */
.pd-top-section {
    padding: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* ── Middle Layout: Engagement + AI side by side ── */
.pd-mid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: relative;
}

.pd-mid-layout::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom,
            transparent,
            var(--border-color) 15%,
            var(--border-color) 85%,
            transparent);
    pointer-events: none;
    z-index: 2;
}

.pd-mid-col {
    padding: 2rem 2.5rem;
}

.pd-mid-col--ai {
    background: linear-gradient(180deg, #fafbfd 0%, #f5f7fa 100%);
}

/* ── Bottom Section: Entities + Comments (full width) ── */
.pd-bottom-section {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border-color);
}

.pd-bottom-section:last-child {
    padding-bottom: 2.5rem;
}

/* ── Entities Grid (responsive 2-col) ── */
.pd-entities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

/* ── Post Header ── */
.pd-post-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.pd-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.pd-title {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.3;
    font-weight: 800;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    letter-spacing: -0.01em;
}

/* ── Sentiment Badge ── */
.pd-sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: transform 0.2s;
}

.pd-sentiment-badge:hover {
    transform: scale(1.05);
}

.pd-sentiment--positive {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.pd-sentiment--negative {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.pd-sentiment--neutral {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ── Meta Chips ── */
.pd-meta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pd-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: #f9fafb;
    border: 1px solid #f0f1f3;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background 0.2s;
}

.pd-meta-chip:hover {
    background: #f0f1f3;
}

.pd-meta-chip i {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ── Post Image ── */
.pd-image-wrapper {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    cursor: zoom-in;
    max-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s;
}

.pd-image-wrapper:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.pd-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-image-wrapper:hover .pd-image {
    transform: scale(1.03);
}

.pd-image-zoom {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s;
}

.pd-image-wrapper:hover .pd-image-zoom {
    opacity: 1;
    transform: scale(1);
}

/* ── Post Content ── */
.pd-content {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* ── Engagement — Premium Redesign ── */
.pd-eng-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 50%, #fff7ed 100%);
    border: 1px solid #fecaca;
    border-radius: 1rem;
    margin-bottom: 1.25rem;
}

.pd-eng-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.pd-eng-hero-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pd-eng-hero-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.15rem;
}

/* Reaction mini-cards grid */
.pd-eng-reactions {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.pd-eng-rx {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.4rem;
    background: white;
    border: 1px solid #f0f1f3;
    border-radius: 0.75rem;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-eng-rx:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    border-color: #d0d3da;
}

.pd-eng-rx i {
    font-size: 1.1rem;
}

.pd-eng-rx-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.pd-eng-rx span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stat cards */
.pd-eng-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.pd-eng-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.75rem;
    background: white;
    border: 1px solid #f0f1f3;
    border-radius: 0.85rem;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pd-eng-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.pd-eng-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.pd-eng-stat-number {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.pd-eng-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Footer */
.pd-eng-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pd-eng-disclaimer {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}

.pd-eng-disclaimer i {
    margin-right: 0.2rem;
}

/* ── Original Link ── */
.pd-original-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 0.7rem 1.4rem;
    background: linear-gradient(135deg, var(--accent-color), #f97316);
    color: white;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}

.pd-original-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
    filter: brightness(1.05);
}

.pd-original-link i {
    transition: transform 0.2s;
}

.pd-original-link:hover i {
    transform: translate(2px, -2px);
}

/* ═══ RIGHT COLUMN — Sections ═══ */

/* Common section wrapper */
.pd-analysis-section {
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--delay, 0) * 0.08s);
}

.pd-analysis-section.pd-visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Section Header */
.pd-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.pd-section-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.pd-section-icon--ai {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.pd-section-icon--entity {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.pd-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.pd-entity-count {
    margin-left: auto;
    background: #ede9fe;
    color: #7c3aed;
    padding: 0.25rem 0.7rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Keywords Block ── */
.pd-keywords-block {
    margin-bottom: 1rem;
}

.pd-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.pd-label i {
    color: #8b5cf6;
    font-size: 0.85rem;
}

.pd-keywords-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pd-keyword {
    display: inline-block;
    background: var(--kw-color);
    color: white;
    padding: 0.3rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--kw-color) 40%, transparent);
    animation: pdKwPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 0.06s);
    opacity: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pd-keyword:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--kw-color) 50%, transparent);
}

/* ── Metrics Grid ── */
.pd-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.pd-metric-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    background: white;
    border: 1px solid #eef0f4;
    border-radius: 0.75rem;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    transform: translateY(10px);
}

.pd-metric-card.pd-visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--i, 0) * 0.06s);
}

.pd-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
    border-color: color-mix(in srgb, var(--mc, #6366f1) 30%, transparent);
}

.pd-metric-card--wide {
    grid-column: 1 / -1;
}

.pd-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: color-mix(in srgb, var(--mc) 12%, transparent);
    color: var(--mc);
    flex-shrink: 0;
}

.pd-metric-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pd-metric-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ═══ Entity Cards ═══ */
.pd-entities-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pd-entity-card {
    background: white;
    padding: 1.15rem 1.25rem;
    border-radius: 0.85rem;
    border: 1px solid #eef0f4;
    border-left: 4px solid #d1d5db;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    transform: translateY(12px);
}

.pd-entity-card.pd-visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--i, 0) * 0.08s);
}

.pd-entity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.pd-entity--attack {
    border-left-color: #ef4444;
}

.pd-entity--positive {
    border-left-color: #10b981;
}

.pd-entity--negative {
    border-left-color: #f59e0b;
}

/* Entity Top */
.pd-entity-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.pd-entity-info {
    flex: 1;
    min-width: 0;
}

.pd-entity-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pd-entity-alias {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 0.3rem;
}

.pd-entity-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Badges */
.pd-entity-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.pd-badge--green {
    background: #ecfdf5;
    color: #059669;
}

.pd-badge--red {
    background: #fef2f2;
    color: #dc2626;
}

.pd-badge--gray {
    background: #f3f4f6;
    color: #6b7280;
}

.pd-badge--danger {
    background: #fef2f2;
    color: #dc2626;
    animation: pdPopIn 0.4s 0.2s both;
}

/* Entity Metrics */
.pd-entity-metrics {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    margin-bottom: 0.65rem;
}

.pd-entity-metric {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.pd-entity-metric strong {
    color: var(--text-primary);
}

/* Entity Summary */
.pd-entity-summary {
    background: #f9fafb;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border: 1px solid #f0f1f3;
}

.pd-entity-summary i {
    color: #d1d5db;
    margin-right: 0.3rem;
    font-size: 0.7rem;
}

/* ═══ Lightbox ═══ */
.pd-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s;
}

.pd-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.pd-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.pd-lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 1rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .pd-mid-layout {
        grid-template-columns: 1fr;
    }

    .pd-mid-layout::after {
        display: none;
    }

    .pd-mid-col--ai {
        border-top: 1px solid var(--border-color);
    }

    .pd-entities-grid {
        grid-template-columns: 1fr;
    }

    .pd-analysis-section {
        opacity: 1;
        transform: none;
    }

    .pd-metric-card {
        opacity: 1;
        transform: none;
    }

    .pd-entity-card {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 768px) {

    .pd-top-section,
    .pd-mid-col,
    .pd-bottom-section {
        padding: 1.5rem;
    }

    .pd-title {
        font-size: 1.2rem;
    }

    .pd-metrics-grid {
        grid-template-columns: 1fr;
    }

    .pd-metric-card--wide {
        grid-column: auto;
    }

    .pd-reactions-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pd-original-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pd-container {
        padding: 0 0.5rem;
    }

    .pd-top-section,
    .pd-mid-col,
    .pd-bottom-section {
        padding: 1.15rem;
    }

    .pd-title-row {
        flex-direction: column;
    }

    .pd-engagement {
        padding: 1rem;
    }

    .pd-stats-row {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════
   Posts Sueltos — Mobile Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* ── Top bar: stack filters vertically ── */
    .src-top-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .src-top-bar__info {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .src-sort-control,
    .src-filter-control {
        margin-left: 0 !important;
    }

    /* ── Tabs bar ── */
    .src-tabs-bar {
        border-radius: 10px !important;
    }

    .src-tab-btn {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        gap: 0.4rem !important;
    }

    /* ── Sueltos container ── */
    .src-sueltos-container {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    /* ── Post cards ── */
    .sueltos-card {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0.85rem 1rem !important;
    }

    .sueltos-card__header {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .sueltos-card__badges {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: flex-start !important;
        margin-top: 0.25rem !important;
    }

    .sueltos-card__media {
        width: 100% !important;
        height: 160px !important;
        border-radius: 8px !important;
    }

    .sueltos-card__content {
        font-size: 0.84rem !important;
    }

    /* ── Pagination ── */
    #srcSueltosPagination {
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }

    /* ── Platform header actions ── */
    .src-platform-header {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .src-platform-header__actions {
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    .src-search-input-wrapper input {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .src-tabs-bar {
        border-radius: 8px !important;
    }

    .src-tab-btn {
        padding: 0.65rem 0.25rem !important;
        font-size: 0.78rem !important;
        gap: 0.3rem !important;
    }

    .src-sueltos-container {
        padding: 0.75rem !important;
    }

    .sueltos-card {
        padding: 0.75rem !important;
        border-radius: 10px !important;
    }

    .sueltos-card__header img {
        width: 28px !important;
        height: 28px !important;
    }

    #srcSueltosMonthNav {
        gap: 0.5rem !important;
        padding: 0.5rem 0.5rem !important;
    }

    #srcSueltosMonthNav span {
        min-width: 120px !important;
        font-size: 0.9rem !important;
    }

    #srcSueltosPagination button {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.78rem !important;
    }
}