/* LEGENDARY BINNER - MODERN ENHANCEMENTS */

/* Particle Background Effect */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

/* Floating Animation for Icons */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.dash-icon {
    animation: float 3s ease-in-out infinite;
}

/* Desabilitar animações pesadas no mobile */
@media (max-width: 768px) {
    .dash-icon {
        animation: none !important;
    }

    .brand:hover {
        animation: none !important;
    }

    .ripple::after {
        display: none;
    }

    .card-glow::after {
        display: none;
    }

    .badge-pulse {
        animation: none !important;
    }

    .skeleton {
        animation: none !important;
        background: var(--panel);
    }
}

/* Glitch Effect for Brand */
@keyframes glitch {
    0% {
        text-shadow: 0 0 20px var(--primary-glow);
    }
    20% {
        text-shadow: 2px 0 var(--primary), -2px 0 var(--info);
    }
    40% {
        text-shadow: 0 0 20px var(--primary-glow);
    }
    60% {
        text-shadow: -2px 0 var(--primary), 2px 0 var(--info);
    }
    80% {
        text-shadow: 0 0 20px var(--primary-glow);
    }
    100% {
        text-shadow: 0 0 20px var(--primary-glow);
    }
}

.brand:hover {
    animation: glitch 0.5s ease-in-out;
}

/* Ripple Effect on Click */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Card Hover Glow */
.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--info), var(--primary));
    background-size: 400% 400%;
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease infinite;
}

.card-glow:hover::after {
    opacity: 0.5;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation for Badges */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 0 8px transparent;
    }
}

/* Smooth Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.2s;
    transition-timing-function: ease-out;
}

/* Mobile: transições mais rápidas */
@media (max-width: 768px) {
    * {
        transition-duration: 0.15s !important;
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--panel) 25%, var(--border) 50%, var(--panel) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* Tooltip */
.tooltip-custom {
    position: relative;
}

.tooltip-custom::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.tooltip-custom:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Morphism */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Neon Glow */
.neon-glow {
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
}

/* Responsive Grid */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-glow);
    color: var(--text);
}

::-moz-selection {
    background: var(--primary-glow);
    color: var(--text);
}


/* ============================================ */
/* OTIMIZAÇÕES MOBILE ADICIONAIS */
/* ============================================ */

@media (max-width: 768px) {
    /* Hardware acceleration para elementos animados */
    #sidebar,
    .mobile-topbar,
    .result-tab,
    .btn-play,
    .btn-stop,
    .nav-link-sidebar {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000px;
        perspective: 1000px;
    }

    /* Otimizar rendering de listas */
    .result-list {
        contain: layout style paint;
        content-visibility: auto;
    }

    /* Otimizar cards */
    .result-card,
    .dash-card {
        contain: layout style;
        will-change: auto;
    }

    /* Remover sombras pesadas no mobile */
    .card,
    .dash-card,
    #sidebar {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }

    /* Simplificar bordas e efeitos */
    .result-tab,
    .btn-play,
    .btn-stop,
    .btn-minimal {
        box-shadow: none !important;
    }

    /* Otimizar inputs */
    input,
    textarea,
    select {
        -webkit-appearance: none;
        appearance: none;
    }

    /* Prevenir bounce scroll no iOS */
    body {
        overscroll-behavior-y: contain;
    }

    /* Otimizar scroll */
    .result-list,
    .result-tabs {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Feedback visual instantâneo */
    .result-tab:active,
    .nav-link-sidebar:active,
    .btn:active,
    button:active {
        opacity: 0.7;
        transition: opacity 0.05s ease;
    }

    /* Prevenir text selection acidental */
    .result-tab,
    .nav-link-sidebar,
    .dash-card,
    .mobile-topbar {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Otimizar fontes no mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeSpeed;
    }

    /* Reduzir complexidade de gradientes */
    .btn-play,
    .btn-stop {
        background: var(--primary) !important;
    }

    .btn-stop {
        background: var(--danger) !important;
    }

    /* Simplificar backdrop filters */
    .glass,
    .lista-config-panel {
        backdrop-filter: none;
        background: var(--panel) !important;
    }
}

/* Otimizações para telas muito pequenas */
@media (max-width: 400px) {
    /* Reduzir padding geral */
    .card-body {
        padding: 10px !important;
    }

    /* Fontes menores */
    body {
        font-size: 14px;
    }

    /* Botões mais compactos */
    .btn-play,
    .btn-stop {
        padding: 10px !important;
        font-size: 0.8rem !important;
    }

    /* Tabs mais compactas */
    .result-tab {
        padding: 10px 16px !important;
        font-size: 0.75rem !important;
    }
}

/* Otimizações para landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    /* Reduzir altura de elementos */
    .mobile-topbar {
        height: 48px;
    }

    #main-content {
        padding-top: 56px !important;
    }

    .result-list {
        height: 200px !important;
    }

    /* Compactar cards */
    .dash-card {
        padding: 8px !important;
    }

    .dash-info h3 {
        font-size: 1.2rem !important;
    }
}

/* Prevenir problemas de performance com animações */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ============================================
   MODERN DASHBOARD STYLES
   ============================================ */

/* Modern Stat Cards */
.modern-stat-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.modern-stat-card:hover::before {
    opacity: 1;
}

.stat-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper i {
    font-size: 28px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

/* Modern Chart Card */
.modern-chart-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.modern-chart-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.chart-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.chart-body {
    padding: 20px 0;
}

.approval-rate-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.rate-circle {
    position: relative;
}

.rate-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rate-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text);
}

.rate-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rate-item strong {
    font-weight: 600;
    margin-left: 4px;
}

/* Modern Actions Card */
.modern-actions-card {
    background: var(--panel);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border);
}

.modern-actions-card h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-actions-card h4 i {
    color: var(--primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

.quick-action-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.quick-action-btn i {
    font-size: 28px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.1);
}

.quick-action-btn span {
    text-align: center;
    line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .quick-actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .modern-stat-card {
        padding: 18px;
    }
    
    .stat-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .stat-icon-wrapper i {
        font-size: 22px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .approval-rate-container {
        gap: 30px;
    }
    
    .rate-circle svg {
        width: 160px;
        height: 160px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .quick-action-btn {
        padding: 14px 8px;
        font-size: 12px;
    }
    
    .quick-action-btn i {
        font-size: 22px;
    }
    
    .quick-action-btn span {
        font-size: 11px;
    }
}
