/**
 * Dashboard Styles
 * Customizacoes de estilo para o dashboard do Sebrae
 */

:root {
    /* Shadcn Theme - Navy/Orange */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 222 67% 18%;
    /* #0F214B */
    --primary-foreground: 210 40% 98%;
    --secondary: 20 85% 57%;
    /* #EF7435 */
    --secondary-foreground: 210 40% 98%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222 67% 18%;
    --radius: 0.5rem;

    /* Legacy variables mapped to new system */
    --primary-color: #0F214B;
    --secondary-color: #EF7435;
    --success-color: #16a34a;
    --warning-color: #eab308;
    --danger-color: hsl(var(--destructive));
    --border-color: hsl(var(--border));
    --text-primary: hsl(var(--foreground));
    --text-secondary: hsl(var(--muted-foreground));
    --bg-primary: hsl(var(--background));
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.glass-dark {
    background: rgba(15, 33, 75, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.card-glass {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card-glass:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8fafc;
    /* Light background */
    background-image:
        radial-gradient(at 0% 0%, rgba(15, 33, 75, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(239, 116, 53, 0.03) 0px, transparent 50%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Ubuntu', sans-serif;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header h1 {
    color: hsl(var(--primary));
    font-weight: 700;
}

/* Progress Bar */
.bg-blue-600 {
    background: linear-gradient(90deg,
            hsl(var(--primary)) 0%,
            hsl(var(--primary) / 0.8) 50%,
            hsl(var(--primary)) 100%);
    background-size: 200% 100%;
    transition: background-color 0.3s ease;
}

/* Animação de progresso ativada apenas quando há buscas em andamento */
/* Efeito shimmer brilhante que passa pela barra para melhor visibilidade */
.animate-progress {
    animation: progress-shimmer 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    position: relative;
}

.animate-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer-slide 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

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

@keyframes shimmer-slide {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Sombra em degradê animada para barras em progresso */
.progress-glow {
    box-shadow: 0 0 8px rgba(15, 33, 75, 0.2);
    animation: glow-pulse 2s ease-in-out infinite;
    transition: box-shadow 0.3s ease;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 8px rgba(15, 33, 75, 0.2);
    }

    50% {
        box-shadow: 0 0 12px rgba(15, 33, 75, 0.3);
    }

    100% {
        box-shadow: 0 0 8px rgba(15, 33, 75, 0.2);
    }
}

@keyframes progress-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Stats Cards */
.bg-white {
    transition: all 0.3s ease;
}

.bg-white:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Tab Navigation */
nav button {
    position: relative;
    transition: all 0.3s ease;
}

nav button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

nav button:hover::after {
    width: 100%;
}

nav button.border-b-2.border-blue-600::after {
    width: 100%;
}

/* Table Styles */
table {
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

thead th {
    color: #1f2937;
    font-weight: 600;
}

tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

tbody tr td {
    color: #1f2937;
}

tbody tr:hover {
    background-color: #f0f9ff;
}

tbody tr:last-child {
    border-bottom: none;
}

/* Modal Styles */
.fixed.inset-0 {
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bg-white.rounded-lg.shadow-xl {
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Result Cards */
.bg-white.rounded-lg.shadow {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.bg-white.rounded-lg.shadow:hover {
    border-left-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Status Indicator */
.text-green-600 {
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {

    0%,
    100% {
        color: #16a34a;
        font-weight: 600;
    }

    50% {
        color: #22c55e;
        font-weight: 700;
    }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 4px rgba(15, 33, 75, 0.2);
}

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 33, 75, 0.3);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    box-shadow: 0 2px 4px rgba(239, 116, 53, 0.2);
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 116, 53, 0.3);
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

button {
    transition: all 0.2s ease;
}

/* Override legacy classes to match new system if they are still used */
.bg-blue-600 {
    background-color: hsl(var(--primary)) !important;
}

.bg-blue-600:hover {
    background-color: hsl(var(--primary) / 0.9) !important;
    box-shadow: 0 4px 12px rgba(15, 33, 75, 0.3);
    transform: translateY(-1px);
}

.text-blue-600 {
    color: hsl(var(--primary));
    transition: color 0.2s ease;
}

.text-blue-600:hover {
    color: hsl(var(--primary) / 0.8);
    font-weight: 600;
}

.text-red-600:hover {
    color: #991b1b;
}

/* Badge Styles */
.inline-flex.items-center.px-3.py-1 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.bg-blue-100.text-blue-800 {
    background: #dbeafe;
    color: #0c4a6e;
    font-weight: 600;
}

.bg-green-100.text-green-800 {
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
}

/* Progress Bar in Score */
.w-24.bg-gray-200 {
    overflow: hidden;
    border-radius: 9999px;
}

.bg-green-600 {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
    transition: width 0.5s ease;
}

/* Text Styling */
h1,
h2,
h3,
h4 {
    color: #1f2937;
    font-weight: 600;
}

p {
    color: #374151;
    line-height: 1.6;
}

/* Improved contrast for secondary text */
.text-gray-600 {
    color: #374151;
}

.text-gray-700 {
    color: #1f2937;
}

.text-gray-500 {
    color: #4b5563;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Input Styles */
input[type="number"] {
    transition: all 0.2s ease;
    border-color: var(--border-color);
}

input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .max-w-7xl {
        padding: 1rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .grid.grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.grid-cols-3 {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.875rem;
    }

    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .py-4,
    .py-3 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .max-w-2xl {
        width: calc(100% - 1rem);
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.875rem;
    }

    .grid.grid-cols-4 {
        grid-template-columns: 1fr;
    }

    nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    nav button {
        font-size: 0.875rem;
        padding: 1rem 0.75rem;
    }
}

/* Loading State */
[x-cloak] {
    display: none !important;
}

/* Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header {
        display: none;
    }

    nav {
        display: none;
    }

    button {
        display: none;
    }

    .text-right {
        display: none;
    }
}

/* Fullscreen Styles for Graph Visualization */
#grafo-viz-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#grafo-viz-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#grafo-viz-container:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#grafo-viz-container:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Micro-interactions Utilities */

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Button Pulse Effect */
.btn-pulse {
    position: relative;
    overflow: hidden;
}

.btn-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.3s;
}

.btn-pulse:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
    transition: 0s;
}

/* Input Focus Ring */
.input-focus-ring:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

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

/* Staggered Animation Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Sidebar Styles */
aside {
    overflow-x: hidden;
}

/* Smooth width transitions for sidebar */
.w-16,
.w-64 {
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon-only mode for collapsed sidebar */
aside:has(.w-16) button,
aside:has(.w-16) a {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Prevent text overflow in collapsed state */
aside [x-show] {
    overflow: hidden;
}