/* =============================================================================
   AURA SHIELD - Dashboard Styles v2.0
   Estilos modernos com gradientes, animacoes e hover effects
   ============================================================================= */

/* -----------------------------------------------------------------------------
   ANIMACOES
   ----------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

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

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -----------------------------------------------------------------------------
   KPI CARDS - Metric Cards
   ----------------------------------------------------------------------------- */
.metric-card {
    animation: fadeInUp 0.5s ease-out;
    border-radius: 16px !important;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

.metric-card h2 {
    animation: countUp 0.6s ease-out 0.2s both;
}

/* Sparkline container */
.metric-card .js-plotly-plot {
    transition: opacity 0.3s ease;
}

.metric-card:hover .js-plotly-plot {
    opacity: 0.8;
}

/* Icon badge in cards */
.metric-card .card-body > div:first-child > div:first-child {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover .card-body > div:first-child > div:first-child {
    transform: scale(1.1) rotate(5deg);
}

/* -----------------------------------------------------------------------------
   CHART CARDS
   ----------------------------------------------------------------------------- */
.chart-card {
    animation: fadeInUp 0.5s ease-out;
    border-radius: 16px !important;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

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

.chart-card:hover .card-header {
    background-color: #f1f5f9 !important;
}

/* Export buttons */
.chart-card .card-header button {
    opacity: 0.6;
    transition: all 0.2s ease;
}

.chart-card:hover .card-header button {
    opacity: 1;
}

.chart-card .card-header button:hover {
    background-color: #e2e8f0 !important;
    transform: scale(1.1);
}

/* -----------------------------------------------------------------------------
   PLATFORM TABS
   ----------------------------------------------------------------------------- */
.platform-tabs .nav-link {
    border-radius: 8px 8px 0 0 !important;
    transition: all 0.3s ease;
    margin-right: 4px;
    border: none !important;
}

.platform-tabs .nav-link:hover:not(.active) {
    background-color: #f1f5f9;
    transform: translateY(-2px);
}

.platform-tabs .nav-link.active {
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

/* Platform specific colors on hover */
.platform-tabs .nav-link[data-bs-target*="whatsapp"]:hover:not(.active) {
    background-color: #dcfce7;
}

.platform-tabs .nav-link[data-bs-target*="facebook"]:hover:not(.active) {
    background-color: #dbeafe;
}

.platform-tabs .nav-link[data-bs-target*="instagram"]:hover:not(.active) {
    background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%);
}

/* -----------------------------------------------------------------------------
   FILTER SECTION
   ----------------------------------------------------------------------------- */
.card .Select-control,
.card .form-control,
.card .Select--single > .Select-control .Select-value {
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.card .Select-control:hover,
.card .form-control:hover {
    border-color: #3b82f6 !important;
}

.card .Select-control:focus-within,
.card .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Dropdown options */
.Select-menu-outer {
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    overflow: hidden;
}

.Select-option {
    transition: background-color 0.2s ease;
}

.Select-option:hover,
.Select-option.is-focused {
    background-color: #f1f5f9 !important;
}

/* -----------------------------------------------------------------------------
   BADGES (Topics)
   ----------------------------------------------------------------------------- */
.badge {
    transition: all 0.2s ease;
    cursor: default;
}

.badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* -----------------------------------------------------------------------------
   WORDCLOUD
   ----------------------------------------------------------------------------- */
.wordcloud-container img,
#wordcloud-whatsapp img,
#wordcloud-facebook img,
#wordcloud-websites img {
    transition: transform 0.3s ease;
    border-radius: 12px;
}

#wordcloud-whatsapp:hover img,
#wordcloud-facebook:hover img,
#wordcloud-websites:hover img {
    transform: scale(1.02);
}

/* -----------------------------------------------------------------------------
   TABLES
   ----------------------------------------------------------------------------- */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* -----------------------------------------------------------------------------
   LOADING STATES
   ----------------------------------------------------------------------------- */
._dash-loading {
    position: relative;
}

._dash-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Loading spinner custom color */
.dash-spinner circle {
    stroke: #3b82f6 !important;
}

/* -----------------------------------------------------------------------------
   PLOTLY CHART ENHANCEMENTS
   ----------------------------------------------------------------------------- */
.js-plotly-plot .plotly .modebar {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.js-plotly-plot:hover .plotly .modebar {
    opacity: 1;
}

.js-plotly-plot .plotly .modebar-btn {
    transition: all 0.2s ease;
}

.js-plotly-plot .plotly .modebar-btn:hover {
    background-color: #e2e8f0 !important;
}

/* Gauge specific */
.js-plotly-plot .gauge {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Heatmap cells */
.heatmaplayer rect {
    transition: opacity 0.2s ease;
}

.heatmaplayer rect:hover {
    opacity: 0.9;
    stroke: #1e293b;
    stroke-width: 2px;
}

/* Treemap segments */
.treemap path {
    transition: opacity 0.2s ease;
}

.treemap path:hover {
    opacity: 0.9;
}

/* -----------------------------------------------------------------------------
   PROGRESS BARS
   ----------------------------------------------------------------------------- */
.progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.progress-bar {
    transition: width 1s ease-in-out;
    border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   ALERTS AND NOTIFICATIONS
   ----------------------------------------------------------------------------- */
.alert {
    border-radius: 12px;
    border: none;
    animation: fadeInUp 0.3s ease-out;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
}

/* -----------------------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------------------- */
.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

/* WhatsApp style button */
.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #22c55e 0%, #0f766e 100%) !important;
}

/* Facebook style button */
.btn-facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0c5ec7 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-facebook:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0a4a9e 100%) !important;
}

/* -----------------------------------------------------------------------------
   SCROLLBAR ENHANCEMENTS
   ----------------------------------------------------------------------------- */
.chart-card .card-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.chart-card .card-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chart-card .card-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chart-card .card-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* -----------------------------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .metric-card h2 {
        font-size: 24px !important;
    }

    .platform-tabs .nav-link {
        padding: 8px 16px !important;
        font-size: 14px;
    }

    .chart-card {
        margin-bottom: 16px;
    }
}

@media (max-width: 576px) {
    .metric-card {
        margin-bottom: 12px;
    }

    .metric-card:hover {
        transform: none;
    }

    .platform-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
    }

    .platform-tabs .nav-link {
        white-space: nowrap;
    }
}

/* -----------------------------------------------------------------------------
   DARK MODE PREPARATION (future)
   ----------------------------------------------------------------------------- */
[data-theme="dark"] .metric-card,
[data-theme="dark"] .chart-card {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .metric-card h2,
[data-theme="dark"] .chart-card .card-header span {
    color: #f1f5f9;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* -----------------------------------------------------------------------------
   UTILITY CLASSES
   ----------------------------------------------------------------------------- */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.animate-in {
    animation: fadeInUp 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}
