@import 'tailwindcss';

@plugin 'tailwindcss-animate';

@source '../views';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';

@custom-variant dark (&:is(.dark *));

@theme {
    --font-sans:
        'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

    --radius-lg: var(--radius);
    --radius-md: calc(var(--radius) - 2px);
    --radius-sm: calc(var(--radius) - 4px);

    --color-background: var(--background);
    --color-foreground: var(--foreground);

    --color-card: var(--card);
    --color-card-foreground: var(--card-foreground);

    --color-popover: var(--popover);
    --color-popover-foreground: var(--popover-foreground);

    --color-primary: var(--primary);
    --color-primary-foreground: var(--primary-foreground);

    --color-secondary: var(--secondary);
    --color-secondary-foreground: var(--secondary-foreground);

    --color-muted: var(--muted);
    --color-muted-foreground: var(--muted-foreground);

    --color-accent: var(--accent);
    --color-accent-foreground: var(--accent-foreground);

    --color-destructive: var(--destructive);
    --color-destructive-foreground: var(--destructive-foreground);

    --color-border: var(--border);
    --color-input: var(--input);
    --color-ring: var(--ring);

    --color-chart-1: var(--chart-1);
    --color-chart-2: var(--chart-2);
    --color-chart-3: var(--chart-3);
    --color-chart-4: var(--chart-4);
    --color-chart-5: var(--chart-5);

    --color-sidebar: var(--sidebar);
    --color-sidebar-foreground: var(--sidebar-foreground);
    --color-sidebar-primary: var(--sidebar-primary);
    --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
    --color-sidebar-accent: var(--sidebar-accent);
    --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
    --color-sidebar-border: var(--sidebar-border);
    --color-sidebar-ring: var(--sidebar-ring);
}

:root {
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.145 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.97 0 0);
    --secondary-foreground: oklch(0.205 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --accent: oklch(0.97 0 0);
    --accent-foreground: oklch(0.205 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.577 0.245 27.325);
    --border: oklch(0.922 0 0);
    --input: oklch(0.922 0 0);
    --ring: oklch(0.87 0 0);
    --chart-1: oklch(0.646 0.222 41.116);
    --chart-2: oklch(0.6 0.118 184.704);
    --chart-3: oklch(0.398 0.07 227.392);
    --chart-4: oklch(0.828 0.189 84.429);
    --chart-5: oklch(0.769 0.188 70.08);
    --radius: 0.625rem;
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: oklch(0.205 0 0);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.87 0 0);

    /* Brand colors for Córdova IA - Futuristic AI Theme */
    --brand-bg: #0f1419;
    --brand-bg-alt: #1a1f2e;
    --brand-text: #ffffff;
    --brand-muted: #94a3b8;
    --brand-primary: #06b6d4;
    --brand-secondary: #8b5cf6;
    --brand-accent-from: #8b5cf6;
    --brand-accent-mid: #06b6d4;
    --brand-accent-to: #10b981;
    --brand-neural-blue: #3b82f6;
    --brand-neural-purple: #8b5cf6;
    --brand-neural-cyan: #06b6d4;
    --brand-ai-glow: rgba(59, 130, 246, 0.3);
}

.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.145 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.145 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.985 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: oklch(0.269 0 0);
    --input: oklch(0.269 0 0);
    --ring: oklch(0.439 0 0);
    --chart-1: oklch(0.488 0.243 264.376);
    --chart-2: oklch(0.696 0.17 162.48);
    --chart-3: oklch(0.769 0.188 70.08);
    --chart-4: oklch(0.627 0.265 303.9);
    --chart-5: oklch(0.645 0.246 16.439);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.985 0 0);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(0.269 0 0);
    --sidebar-ring: oklch(0.439 0 0);
}

@layer base {
    * {
        @apply border-border;
    }

    body {
        @apply bg-background text-foreground;
    }
}

@layer utilities {
    .bg-brand-bg { background-color: var(--brand-bg); }
    .bg-brand-bg-alt { background-color: var(--brand-bg-alt); }
    .text-brand-text { color: var(--brand-text); }
    .text-brand-muted { color: var(--brand-muted); }
    .bg-brand-primary { background-color: var(--brand-primary); }
    .text-brand-primary { color: var(--brand-primary); }
    .bg-brand-secondary { background-color: var(--brand-secondary); }
    .text-brand-secondary { color: var(--brand-secondary); }
    .from-brand-accent-from { --tw-gradient-from: var(--brand-accent-from); }
    .via-brand-accent-mid { --tw-gradient-via: var(--brand-accent-mid); }
    .to-brand-accent-to { --tw-gradient-to: var(--brand-accent-to); }

    .shadow-elev {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    .shadow-ai-glow {
        box-shadow: 0 0 30px var(--brand-ai-glow), 0 0 60px var(--brand-ai-glow);
    }

    .bg-brand-bgAlt {
        background-color: var(--brand-bg-alt);
    }

    /* Neural network animations */
    @keyframes neural-pulse {
        0%, 100% { opacity: 0.3; transform: scale(1); }
        50% { opacity: 1; transform: scale(1.1); }
    }

    @keyframes data-flow {
        0% { transform: translateX(-100px) translateY(-100px); opacity: 0; }
        50% { opacity: 1; }
        100% { transform: translateX(100px) translateY(100px); opacity: 0; }
    }

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

    .data-flow {
        animation: data-flow 3s linear infinite;
    }

    /* AI-specific gradients */
    .bg-ai-neural {
        background: linear-gradient(135deg, var(--brand-neural-blue), var(--brand-neural-purple), var(--brand-neural-cyan));
    }

    .text-ai-neural {
        background: linear-gradient(135deg, var(--brand-neural-blue), var(--brand-neural-purple), var(--brand-neural-cyan));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* Mobile-first responsive optimizations */
    @media (max-width: 767px) {
        .neural-pulse {
            animation-duration: 3s;
        }

        .data-flow {
            animation-duration: 4s;
        }

        /* Reduce particle density on mobile */
        .ai-particles {
            opacity: 0.7;
        }

        /* Optimize text sizes for mobile */
        .mobile-optimized-text {
            font-size: clamp(1rem, 4vw, 1.5rem);
            line-height: 1.4;
        }

        /* Mobile-specific hover states */
        .mobile-touch-friendly {
            min-height: 44px;
            min-width: 44px;
        }
    }

    @media (min-width: 768px) and (max-width: 1023px) {
        /* Tablet optimizations */
        .neural-pulse {
            animation-duration: 2.5s;
        }

        .ai-particles {
            opacity: 0.85;
        }
    }

    @media (min-width: 1024px) {
        /* Desktop optimizations */
        .enhanced-animations {
            will-change: transform, opacity;
        }

        .ai-particles {
            opacity: 1;
        }
    }

    /* Performance optimizations */
    @media (prefers-reduced-motion: reduce) {
        .neural-pulse,
        .data-flow,
        .ai-particles {
            animation: none !important;
        }

        * {
            transition-duration: 0.01ms !important;
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
        }
    }

    /* Touch device optimizations */
    @media (pointer: coarse) {
        .hover\:scale-105:hover {
            transform: scale(1.02);
        }

        .hover\:shadow-2xl:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
    }

    /* Code highlighting styles for floating chat */
    .floating-chat-message pre {
        @apply rounded-lg overflow-x-auto text-xs leading-relaxed;
        font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    }

    .floating-chat-message code {
        font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    }

    /* Highlight.js theme overrides for better integration */
    .floating-chat-message .hljs {
        @apply bg-slate-800 text-slate-200;
        padding: 1rem;
        border-radius: 0.5rem;
    }

    .floating-chat-message .hljs-keyword,
    .floating-chat-message .hljs-selector-tag,
    .floating-chat-message .hljs-literal,
    .floating-chat-message .hljs-section,
    .floating-chat-message .hljs-link {
        @apply text-purple-400;
    }

    .floating-chat-message .hljs-function .hljs-keyword {
        @apply text-cyan-400;
    }

    .floating-chat-message .hljs-subst {
        @apply text-slate-200;
    }

    .floating-chat-message .hljs-string,
    .floating-chat-message .hljs-title,
    .floating-chat-message .hljs-name,
    .floating-chat-message .hljs-type,
    .floating-chat-message .hljs-attribute,
    .floating-chat-message .hljs-symbol,
    .floating-chat-message .hljs-bullet,
    .floating-chat-message .hljs-addition,
    .floating-chat-message .hljs-variable,
    .floating-chat-message .hljs-template-tag,
    .floating-chat-message .hljs-template-variable {
        @apply text-emerald-400;
    }

    .floating-chat-message .hljs-comment,
    .floating-chat-message .hljs-quote,
    .floating-chat-message .hljs-deletion,
    .floating-chat-message .hljs-meta {
        @apply text-slate-500;
    }

    .floating-chat-message .hljs-keyword,
    .floating-chat-message .hljs-selector-tag,
    .floating-chat-message .hljs-literal,
    .floating-chat-message .hljs-title,
    .floating-chat-message .hljs-section,
    .floating-chat-message .hljs-doctag,
    .floating-chat-message .hljs-type,
    .floating-chat-message .hljs-name,
    .floating-chat-message .hljs-strong {
        @apply font-semibold;
    }

    .floating-chat-message .hljs-number {
        @apply text-orange-400;
    }

    .floating-chat-message .hljs-emphasis {
        @apply italic;
    }

    .floating-chat-message .hljs-strong {
        @apply font-bold;
    }

    /* Dark mode code blocks for user messages */
    .floating-chat-user-message .hljs {
        @apply bg-black/40 text-purple-100 border border-white/20;
    }

    .floating-chat-user-message .hljs-keyword,
    .floating-chat-user-message .hljs-selector-tag,
    .floating-chat-user-message .hljs-literal {
        @apply text-purple-200;
    }

    .floating-chat-user-message .hljs-string,
    .floating-chat-user-message .hljs-title {
        @apply text-cyan-200;
    }

    .floating-chat-user-message .hljs-comment {
        @apply text-purple-300/70;
    }

    .floating-chat-user-message .hljs-number {
        @apply text-orange-300;
    }
}

@theme inline {
    --color-sidebar:
        var(--sidebar);
    --color-sidebar-foreground:
        var(--sidebar-foreground);
    --color-sidebar-primary:
        var(--sidebar-primary);
    --color-sidebar-primary-foreground:
        var(--sidebar-primary-foreground);
    --color-sidebar-accent:
        var(--sidebar-accent);
    --color-sidebar-accent-foreground:
        var(--sidebar-accent-foreground);
    --color-sidebar-border:
        var(--sidebar-border);
    --color-sidebar-ring:
        var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
    }
  body {
    @apply bg-background text-foreground;
    }
}
