@import 'tailwindcss';

@source '../../resources/views/**/*.blade.php';
@source '../../app/**/*.php';

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

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@theme {
    --font-sans: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
    --color-brand-50: #f4f2ff;
    --color-brand-100: #eae5ff;
    --color-brand-200: #d7cdff;
    --color-brand-300: #bda9ff;
    --color-brand-400: #9c7bff;
    --color-brand-500: #7c4dff;
    --color-brand-600: #6a2ce8;
    --color-brand-700: #591fc4;
    --color-brand-800: #481ba0;
    --color-brand-900: #3a187f;
    --color-ink-900: #0b0716;
    --color-ink-800: #130d24;
}

@layer base {
    html {
        font-family: var(--font-sans);
    }

    body {
        @apply bg-slate-50 text-slate-800 antialiased;
    }

    .dark body {
        @apply bg-ink-900 text-slate-200;
    }

    ::selection {
        @apply bg-brand-200 text-brand-900;
    }

    /* Thin, quiet scrollbars keep the financial tables readable */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    ::-webkit-scrollbar-thumb {
        @apply rounded-full bg-slate-300 dark:bg-slate-700;
    }
}

@layer components {
    .app-shell {
        @apply min-h-screen bg-gradient-to-br from-slate-50 via-white to-brand-50/60 dark:from-ink-900 dark:via-ink-900 dark:to-brand-900/30;
    }

    .glass {
        @apply border border-white/70 bg-white/80 shadow-sm backdrop-blur-xl dark:border-white/10 dark:bg-white/[0.04];
    }

    .card {
        @apply rounded-2xl border border-slate-200/80 bg-white shadow-sm dark:border-white/10 dark:bg-white/[0.03];
    }

    .card-head {
        @apply flex items-center justify-between gap-3 border-b border-slate-100 px-4 py-3 dark:border-white/10;
    }

    .card-title {
        @apply text-sm font-bold text-slate-700 dark:text-slate-200;
    }

    .card-body {
        @apply p-4;
    }

    .label {
        @apply mb-1.5 block text-xs font-medium text-slate-600 dark:text-slate-300;
    }

    .input {
        @apply w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-800 shadow-sm transition
            placeholder:text-slate-400 focus:border-brand-400 focus:ring-2 focus:ring-brand-100 focus:outline-none
            dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-100 dark:placeholder:text-slate-500 dark:focus:ring-brand-900;
    }

    .input-error {
        @apply border-rose-300 focus:border-rose-400 focus:ring-rose-100;
    }

    .btn,
    .btn-primary,
    .btn-ghost,
    .btn-danger,
    .btn-soft {
        @apply inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-sm font-medium transition
            focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-60;
    }

    .btn-primary {
        @apply bg-gradient-to-l from-brand-600 to-brand-500 text-white shadow-sm shadow-brand-500/30
            hover:from-brand-700 hover:to-brand-600 focus:ring-brand-300;
    }

    .btn-ghost {
        @apply border border-slate-200 bg-white text-slate-700 hover:bg-slate-50
            dark:border-white/10 dark:bg-white/[0.04] dark:text-slate-200 dark:hover:bg-white/10;
    }

    .btn-danger {
        @apply bg-rose-600 text-white hover:bg-rose-700 focus:ring-rose-300;
    }

    .btn-soft {
        @apply bg-brand-50 text-brand-700 hover:bg-brand-100 dark:bg-brand-900/40 dark:text-brand-200;
    }

    .badge,
    .badge-green,
    .badge-amber,
    .badge-rose,
    .badge-slate,
    .badge-brand {
        @apply inline-flex items-center rounded-full px-2.5 py-0.5 text-[11px] font-medium;
    }

    .badge-green {
        @apply bg-emerald-50 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300;
    }

    .badge-amber {
        @apply bg-amber-50 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300;
    }

    .badge-rose {
        @apply bg-rose-50 text-rose-700 dark:bg-rose-900/40 dark:text-rose-300;
    }

    .badge-slate {
        @apply bg-slate-100 text-slate-600 dark:bg-white/10 dark:text-slate-300;
    }

    .badge-brand {
        @apply bg-brand-50 text-brand-700 dark:bg-brand-900/40 dark:text-brand-200;
    }

    .nav-link {
        @apply flex items-center gap-2 rounded-xl px-3 py-2 text-sm text-slate-600 transition
            hover:bg-white hover:text-brand-700 hover:shadow-sm
            dark:text-slate-300 dark:hover:bg-white/10 dark:hover:text-white;
    }

    .nav-link-active {
        @apply bg-gradient-to-l from-brand-600 to-brand-500 font-medium text-white shadow-sm shadow-brand-500/30
            hover:from-brand-600 hover:to-brand-500 hover:text-white;
    }

    .nav-group {
        @apply mt-4 mb-1 px-3 text-[11px] font-bold tracking-wide text-slate-400 uppercase dark:text-slate-500;
    }

    .table-wrap {
        @apply w-full overflow-x-auto;
    }

    .table {
        @apply w-full min-w-full text-right text-sm;
    }

    .table thead th {
        @apply whitespace-nowrap border-b border-slate-100 px-3 py-2.5 text-xs font-bold text-slate-500 dark:border-white/10 dark:text-slate-400;
    }

    .table tbody td {
        @apply border-b border-slate-50 px-3 py-2.5 align-middle dark:border-white/5;
    }

    .table tbody tr:hover {
        @apply bg-brand-50/40 dark:bg-white/[0.03];
    }

    .money {
        @apply font-medium tabular-nums;
    }

    .stat-value {
        @apply text-xl font-bold tabular-nums text-slate-800 dark:text-white;
    }

    .link {
        @apply text-brand-600 hover:text-brand-700 hover:underline dark:text-brand-300;
    }

    .alert,
    .alert-success,
    .alert-error,
    .alert-info {
        @apply rounded-xl border px-4 py-3 text-sm;
    }

    .alert-success {
        @apply border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-200;
    }

    .alert-error {
        @apply border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-800 dark:bg-rose-900/30 dark:text-rose-200;
    }

    .alert-info {
        @apply border-brand-200 bg-brand-50 text-brand-800 dark:border-brand-800 dark:bg-brand-900/30 dark:text-brand-200;
    }

    .skeleton {
        @apply animate-pulse rounded-lg bg-slate-200/70 dark:bg-white/10;
    }
}

/* Dark mode: muted greys from the light palette are too dark on the ink ground. */
.dark .text-slate-400 {
    color: rgb(156 163 185);
}

.dark .text-slate-500 {
    color: rgb(174 180 201);
}

.dark .table thead th {
    color: rgb(178 184 205);
}

.dark .input::placeholder {
    color: rgb(140 146 168);
}

[x-cloak] {
    display: none !important;
}

@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .print-page {
        box-shadow: none !important;
        border: 0 !important;
    }
}


/* ------------------------------------------------------------------
   Public marketing site. Everything below is decoration: soft aurora
   light behind the hero, a faint grid, slow floating marks and the
   module strip. It carries no meaning, so it is removed for anyone who
   asked for reduced motion.
   ------------------------------------------------------------------ */
.aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora::before,
.aurora::after {
    content: '';
    position: absolute;
    width: 40rem;
    height: 40rem;
    border-radius: 9999px;
    filter: blur(90px);
}

.aurora::before {
    top: -16rem;
    inset-inline-start: -12rem;
    background: radial-gradient(circle at 35% 35%, rgb(167 139 250 / 0.55), transparent 62%);
}

.aurora::after {
    bottom: -20rem;
    inset-inline-end: -10rem;
    background: radial-gradient(circle at 60% 60%, rgb(251 191 36 / 0.35), transparent 62%);
}

.dark .aurora::before {
    opacity: 0.45;
}

.dark .aurora::after {
    opacity: 0.3;
}

.faint-grid {
    background-image:
        linear-gradient(to right, rgb(15 23 42 / 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(15 23 42 / 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
    mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
}

.dark .faint-grid {
    background-image:
        linear-gradient(to right, rgb(255 255 255 / 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgb(255 255 255 / 0.06) 1px, transparent 1px);
}

@keyframes rm-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.float-soft {
    animation: rm-float 8s ease-in-out infinite;
}

.float-softer {
    animation: rm-float 12s ease-in-out infinite;
}

@keyframes rm-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(50%);
    }
}

.module-strip {
    display: flex;
    width: max-content;
    gap: 0.75rem;
    animation: rm-marquee 40s linear infinite;
}

.module-strip-mask {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .float-soft,
    .float-softer,
    .module-strip {
        animation: none;
    }
}
