@import 'tailwindcss';

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

/* Class-based dark mode: <html class="dark"> (toggled by the theme store). */
@custom-variant dark (&:where(.dark, .dark *));

@theme {
    /* System font stack on purpose: zero network requests, works offline, feels native. */
    --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Bengali', 'Helvetica Neue', Arial,
        sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';

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

    --color-canvas: #f6f7fb;
    --color-canvas-dark: #0b0f1a;
    --color-surface-dark: #121826;

    --shadow-soft: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px -12px rgb(15 23 42 / 0.12);
    --shadow-float: 0 10px 40px -10px rgb(15 23 42 / 0.25);

    --animate-slide-up: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    --animate-fade-in: fade-in 0.2s ease-out;
    --animate-pulse-ring: pulse-ring 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;

    @keyframes slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    @keyframes fade-in {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    @keyframes pulse-ring {
        0% {
            box-shadow: 0 0 0 0 currentColor;
            opacity: 1;
        }
        70%,
        100% {
            box-shadow: 0 0 0 6px transparent;
        }
    }
}

/* ------------------------------------------------------------------ */
/* Base — native-app feel                                              */
/* ------------------------------------------------------------------ */
@layer base {
    html {
        -webkit-tap-highlight-color: transparent;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        background-color: var(--color-canvas);
        overscroll-behavior-y: none;
    }
    html.dark {
        background-color: var(--color-canvas-dark);
    }
    body {
        min-height: 100dvh;
        @apply bg-canvas text-slate-900 dark:bg-canvas-dark dark:text-slate-100;
        touch-action: manipulation;
    }
    button,
    a,
    [role='button'] {
        touch-action: manipulation;
    }
    /* Prevent iOS zoom on input focus */
    @media (max-width: 767px) {
        input,
        select,
        textarea {
            font-size: 16px !important;
        }
    }
    ::selection {
        @apply bg-brand-500/25;
    }
    :focus-visible {
        @apply outline-2 outline-offset-2 outline-brand-500;
    }
}

/* ------------------------------------------------------------------ */
/* Reusable building blocks                                            */
/* ------------------------------------------------------------------ */
@layer components {
    .card {
        @apply rounded-2xl border border-slate-200/70 bg-white shadow-soft dark:border-white/[0.07] dark:bg-surface-dark dark:shadow-none;
    }

    .input {
        @apply block w-full rounded-xl border border-slate-200 bg-white px-3.5 py-2.5 text-sm text-slate-900 shadow-sm transition outline-none placeholder:text-slate-400 focus:border-brand-500 focus:ring-4 focus:ring-brand-500/15 disabled:cursor-not-allowed disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-100 dark:placeholder:text-slate-500 dark:focus:border-brand-400;
    }
    .input-error {
        @apply border-red-400 focus:border-red-500 focus:ring-red-500/15 dark:border-red-400/70;
    }
    .label {
        @apply mb-1.5 block text-sm font-medium text-slate-700 dark:text-slate-300;
    }
    .field-error {
        @apply mt-1.5 text-xs font-medium text-red-600 dark:text-red-400;
    }

    .btn {
        @apply inline-flex cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition duration-150 select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-500 active:scale-[0.97] disabled:pointer-events-none disabled:opacity-60;
    }
    .btn-primary {
        @apply bg-linear-to-br from-brand-500 to-violet-600 text-white shadow-lg shadow-brand-500/25 hover:from-brand-600 hover:to-violet-700;
    }
    .btn-secondary {
        @apply border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 dark:border-white/10 dark:bg-white/[0.05] dark:text-slate-200 dark:hover:bg-white/10;
    }
    .btn-ghost {
        @apply text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/10;
    }
    .btn-danger {
        @apply bg-red-600 text-white hover:bg-red-700;
    }
    .btn-icon {
        @apply inline-flex size-10 cursor-pointer items-center justify-center rounded-xl text-slate-500 transition select-none hover:bg-slate-100 hover:text-slate-900 active:scale-90 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-white;
    }

    .glass {
        @apply border border-white/60 bg-white/70 backdrop-blur-xl dark:border-white/10 dark:bg-slate-900/70;
    }
}

/* ------------------------------------------------------------------ */
/* Transitions                                                         */
/* ------------------------------------------------------------------ */
.page-enter-active,
.page-leave-active {
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}
.page-enter-from {
    opacity: 0;
    transform: translateY(8px);
}
.page-leave-to {
    opacity: 0;
    transform: translateY(-4px);
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.pop-enter-active,
.pop-leave-active {
    transition:
        opacity 0.15s ease,
        transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: top right;
}
.pop-enter-from,
.pop-leave-to {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
}

.slide-down-enter-active,
.slide-down-leave-active {
    transition:
        max-height 0.25s ease,
        opacity 0.2s ease;
    overflow: hidden;
}
.slide-down-enter-from,
.slide-down-leave-to {
    max-height: 0;
    opacity: 0;
}
.slide-down-enter-to,
.slide-down-leave-from {
    max-height: 5rem;
}

/* Bottom sheet (mobile) / dialog (desktop) */
.sheet-enter-active,
.sheet-leave-active {
    transition: opacity 0.2s ease;
}
.sheet-enter-active .sheet-panel,
.sheet-leave-active .sheet-panel {
    transition:
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.2s ease;
}
.sheet-enter-from,
.sheet-leave-to {
    opacity: 0;
}
.sheet-enter-from .sheet-panel,
.sheet-leave-to .sheet-panel {
    transform: translateY(100%);
}
@media (min-width: 768px) {
    .sheet-enter-from .sheet-panel,
    .sheet-leave-to .sheet-panel {
        transform: translateY(12px) scale(0.97);
        opacity: 0;
    }
}

.toast-enter-active,
.toast-leave-active {
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast-enter-from,
.toast-leave-to {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
}
.toast-move {
    transition: transform 0.25s ease;
}

/* Hide scrollbars on horizontal chip rows */
.no-scrollbar {
    scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Safe-area helpers (notch / home indicator) */
.pt-safe {
    padding-top: env(safe-area-inset-top);
}
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
