/**
 * Main Application Stylesheet
 *
 * This file imports Tailwind CSS and defines custom styles for the application.
 */

/* Import Tailwind CSS */
@import 'tailwindcss';

/* Configure dark mode variant */
@variant dark (&:where(.dark, .dark *));

/* Source files for Tailwind to scan */
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';
@source '../**/*.vue';

/* Custom theme configuration */
@theme {
    /* Use Inter as the default sans-serif font */
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

    /* Use JetBrains Mono as the default monospace font */
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Custom Color Palette */
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-primary-200: #bfdbfe;
    --color-primary-300: #93c5fd;
    --color-primary-400: #60a5fa;
    --color-primary-500: #3b82f6;
    --color-primary-600: #2563eb;
    --color-primary-700: #1d4ed8;
    --color-primary-800: #1e40af;
    --color-primary-900: #1e3a8a;
    --color-primary-950: #172554;

    --color-secondary-50: #f8fafc;
    --color-secondary-100: #f1f5f9;
    --color-secondary-200: #e2e8f0;
    --color-secondary-300: #cbd5e1;
    --color-secondary-400: #94a3b8;
    --color-secondary-500: #64748b;
    --color-secondary-600: #475569;
    --color-secondary-700: #334155;
    --color-secondary-800: #1e293b;
    --color-secondary-900: #0f172a;
    --color-secondary-950: #020617;

    --color-success-50: #f0fdf4;
    --color-success-100: #dcfce7;
    --color-success-200: #bbf7d0;
    --color-success-300: #86efac;
    --color-success-400: #4ade80;
    --color-success-500: #22c55e;
    --color-success-600: #16a34a;
    --color-success-700: #15803d;
    --color-success-800: #166534;
    --color-success-900: #14532d;
    --color-success-950: #052e16;

    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-200: #fde68a;
    --color-warning-300: #fcd34d;
    --color-warning-400: #fbbf24;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;
    --color-warning-700: #b45309;
    --color-warning-800: #92400e;
    --color-warning-900: #78350f;
    --color-warning-950: #451a03;

    --color-danger-50: #fef2f2;
    --color-danger-100: #fee2e2;
    --color-danger-200: #fecaca;
    --color-danger-300: #fca5a5;
    --color-danger-400: #f87171;
    --color-danger-500: #ef4444;
    --color-danger-600: #dc2626;
    --color-danger-700: #b91c1c;
    --color-danger-800: #991b1b;
    --color-danger-900: #7f1d1d;
    --color-danger-950: #450a0a;

    --color-info-50: #f0f9ff;
    --color-info-100: #e0f2fe;
    --color-info-200: #bae6fd;
    --color-info-300: #7dd3fc;
    --color-info-400: #38bdf8;
    --color-info-500: #0ea5e9;
    --color-info-600: #0284c7;
    --color-info-700: #0369a1;
    --color-info-800: #075985;
    --color-info-900: #0c4a6e;
    --color-info-950: #082f49;

    /* Default Gray Color Palette (for compatibility) */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-gray-950: #030712;

    /* Additional default colors for compatibility */
    --color-red-50: #fef2f2;
    --color-red-100: #fee2e2;
    --color-red-200: #fecaca;
    --color-red-300: #fca5a5;
    --color-red-400: #f87171;
    --color-red-500: #ef4444;
    --color-red-600: #dc2626;
    --color-red-700: #b91c1c;
    --color-red-800: #991b1b;
    --color-red-900: #7f1d1d;
    --color-red-950: #450a0a;

    --color-blue-50: #eff6ff;
    --color-blue-100: #dbeafe;
    --color-blue-200: #bfdbfe;
    --color-blue-300: #93c5fd;
    --color-blue-400: #60a5fa;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-700: #1d4ed8;
    --color-blue-800: #1e40af;
    --color-blue-900: #1e3a8a;
    --color-blue-950: #172554;

    --color-green-50: #f0fdf4;
    --color-green-100: #dcfce7;
    --color-green-200: #bbf7d0;
    --color-green-300: #86efac;
    --color-green-400: #4ade80;
    --color-green-500: #22c55e;
    --color-green-600: #16a34a;
    --color-green-700: #15803d;
    --color-green-800: #166534;
    --color-green-900: #14532d;
    --color-green-950: #052e16;

    --color-yellow-50: #fefce8;
    --color-yellow-100: #fef9c3;
    --color-yellow-200: #fef08a;
    --color-yellow-300: #fde047;
    --color-yellow-400: #facc15;
    --color-yellow-500: #eab308;
    --color-yellow-600: #ca8a04;
    --color-yellow-700: #a16207;
    --color-yellow-800: #854d0e;
    --color-yellow-900: #713f12;
    --color-yellow-950: #422006;

    --color-indigo-50: #eef2ff;
    --color-indigo-100: #e0e7ff;
    --color-indigo-200: #c7d2fe;
    --color-indigo-300: #a5b4fc;
    --color-indigo-400: #818cf8;
    --color-indigo-500: #6366f1;
    --color-indigo-600: #4f46e5;
    --color-indigo-700: #4338ca;
    --color-indigo-800: #3730a3;
    --color-indigo-900: #312e81;
    --color-indigo-950: #1e1b4b;

    --color-purple-50: #faf5ff;
    --color-purple-100: #f3e8ff;
    --color-purple-200: #e9d5ff;
    --color-purple-300: #d8b4fe;
    --color-purple-400: #c084fc;
    --color-purple-500: #a855f7;
    --color-purple-600: #9333ea;
    --color-purple-700: #7e22ce;
    --color-purple-800: #6b21a8;
    --color-purple-900: #581c87;
    --color-purple-950: #3b0764;

    --color-pink-50: #fdf2f8;
    --color-pink-100: #fce7f3;
    --color-pink-200: #fbcfe8;
    --color-pink-300: #f9a8d4;
    --color-pink-400: #f472b6;
    --color-pink-500: #ec4899;
    --color-pink-600: #db2777;
    --color-pink-700: #be185d;
    --color-pink-800: #9d174d;
    --color-pink-900: #831843;
    --color-pink-950: #500724;

    --color-white: #ffffff;
    --color-black: #000000;
}

/* Base styles */
@layer base {
    /* Apply smooth scrolling */
    html {
        scroll-behavior: smooth;
    }

    /* Base body styles */
    body {
        @apply font-sans text-secondary-900 bg-secondary-50 antialiased;
    }

    /* Focus outline styles */
    *:focus {
        outline: 2px solid transparent;
        outline-offset: 2px;
    }

    *:focus-visible {
        @apply ring-2 ring-primary-500 ring-offset-2;
    }

    /* Improve font rendering */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Custom component styles */
@layer components {
    /* Scrollbar styles */
    .scrollbar-thin::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .scrollbar-thin::-webkit-scrollbar-track {
        @apply bg-secondary-100 rounded-lg;
    }

    .scrollbar-thin::-webkit-scrollbar-thumb {
        @apply bg-secondary-300 rounded-lg hover:bg-secondary-400;
    }

    /* Dark mode scrollbar */
    .dark .scrollbar-thin::-webkit-scrollbar-track {
        @apply bg-secondary-800;
    }

    .dark .scrollbar-thin::-webkit-scrollbar-thumb {
        @apply bg-secondary-600 hover:bg-secondary-500;
    }

    /* Loading skeleton animation */
    .skeleton {
        @apply animate-pulse bg-secondary-200 dark:bg-secondary-700;
    }

    /* Page transition classes */
    .page-enter-active,
    .page-leave-active {
        transition: opacity 0.15s ease;
    }

    .page-enter-from,
    .page-leave-to {
        opacity: 0;
    }

    /* Toast notification container */
    .toast-container {
        @apply fixed top-4 right-4 z-50 space-y-2;
    }

    /* Custom link styles */
    .link {
        @apply text-primary-600 hover:text-primary-700 underline underline-offset-2 transition-colors;
    }
}

/* Utility classes */
@layer utilities {
    /* Text gradient */
    .text-gradient {
        @apply bg-clip-text text-transparent bg-gradient-to-r from-primary-600 to-primary-400;
    }

    /* Truncate with specific lines */
    .line-clamp-1 {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .line-clamp-2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .line-clamp-3 {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Hide scrollbar */
    .no-scrollbar::-webkit-scrollbar {
        display: none;
    }

    .no-scrollbar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Glass morphism effect */
    .glass {
        @apply bg-white/70 dark:bg-secondary-800/70 backdrop-blur-lg;
    }

    /* Gradient borders */
    .border-gradient {
        border: 2px solid transparent;
        background-clip: padding-box;
        position: relative;
    }

    .border-gradient::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        margin: -2px;
        border-radius: inherit;
        background: linear-gradient(to right, #2563eb, #60a5fa);
    }
}

/* Dark mode specific styles */
@media (prefers-color-scheme: dark) {
    /* Apply dark mode by default if user prefers dark */
    :root:not(.light) {
        color-scheme: dark;
    }

    :root:not(.light) body {
        @apply bg-secondary-900 text-secondary-100;
    }
}

/* Explicit dark mode class */
.dark {
    color-scheme: dark;
}

.dark body {
    @apply bg-secondary-900 text-secondary-100;
}

/* Print styles */
@media print {
    body {
        @apply bg-white text-black;
    }

    /* Hide elements that shouldn't be printed */
    .no-print {
        display: none !important;
    }
}

/* Animations for Inertia page transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Custom scrollbar for the entire app */
body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    @apply bg-secondary-100 dark:bg-secondary-800;
}

body::-webkit-scrollbar-thumb {
    @apply bg-secondary-300 dark:bg-secondary-600 rounded-lg hover:bg-secondary-400 dark:hover:bg-secondary-500;
}
