@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');
@import 'tailwindcss';
@plugin "@tailwindcss/typography";

@import 'tw-animate-css';

@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(0.986 0.005 220);
    --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.567 0.117 220);
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.94 0.018 220);
    --secondary-foreground: oklch(0.32 0.08 220);
    --muted: oklch(0.97 0.005 220);
    --muted-foreground: oklch(0.50 0.025 220);
    --accent: oklch(0.93 0.025 220);
    --accent-foreground: oklch(0.32 0.08 220);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(1 0 0);
    --border: oklch(0.91 0.01 220);
    --input: oklch(0.91 0.01 220);
    --ring: oklch(0.567 0.117 220);
    --chart-1: oklch(0.567 0.117 220);
    --chart-2: oklch(0.6 0.15 184.704);
    --chart-3: oklch(0.7 0.18 300);
    --chart-4: oklch(0.75 0.18 84);
    --chart-5: oklch(0.65 0.2 25);
    --radius: 0.625rem;
    --sidebar: oklch(0.97 0.018 220);
    --sidebar-foreground: oklch(0.20 0.05 220);
    --sidebar-primary: oklch(0.567 0.117 220);
    --sidebar-primary-foreground: oklch(1 0 0);
    --sidebar-accent: oklch(0.91 0.04 220);
    --sidebar-accent-foreground: oklch(0.20 0.05 220);
    --sidebar-border: oklch(0.88 0.025 220);
    --sidebar-ring: oklch(0.567 0.117 220);
}

.dark {
    --background: oklch(0.13 0.015 220);
    --foreground: oklch(0.95 0.01 220);
    --card: oklch(0.17 0.02 220);
    --card-foreground: oklch(0.95 0.01 220);
    --popover: oklch(0.17 0.02 220);
    --popover-foreground: oklch(0.95 0.01 220);
    --primary: oklch(0.65 0.12 220);
    --primary-foreground: oklch(0.10 0.02 220);
    --secondary: oklch(0.24 0.04 220);
    --secondary-foreground: oklch(0.95 0.01 220);
    --muted: oklch(0.22 0.02 220);
    --muted-foreground: oklch(0.64 0.04 220);
    --accent: oklch(0.24 0.04 220);
    --accent-foreground: oklch(0.95 0.01 220);
    --destructive: oklch(0.5 0.2 25);
    --destructive-foreground: oklch(1 0 0);
    --border: oklch(0.27 0.03 220);
    --input: oklch(0.27 0.03 220);
    --ring: oklch(0.65 0.12 220);
    --chart-1: oklch(0.65 0.12 220);
    --chart-2: oklch(0.65 0.17 162);
    --chart-3: oklch(0.75 0.18 70);
    --chart-4: oklch(0.65 0.25 300);
    --chart-5: oklch(0.65 0.24 25);
    --sidebar: oklch(0.18 0.03 220);
    --sidebar-foreground: oklch(0.92 0.01 220);
    --sidebar-primary: oklch(0.65 0.12 220);
    --sidebar-primary-foreground: oklch(0.10 0.02 220);
    --sidebar-accent: oklch(0.25 0.04 220);
    --sidebar-accent-foreground: oklch(0.95 0.01 220);
    --sidebar-border: oklch(0.26 0.04 220);
    --sidebar-ring: oklch(0.65 0.12 220);
}

/* Rich editor — responsive embeds */
.tiptap [data-youtube-video] {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
}

.tiptap [data-youtube-video] iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.tiptap [data-type="iframe"] iframe {
    width: 100% !important;
}

/* Force light-mode CSS variables inside auth form panel.
   Must override both semantic (--background) AND compiled (--color-background)
   tokens because Tailwind v4 resolves @theme vars at :root computed time. */
[data-scheme="light"] {
    color-scheme: light;
    color: oklch(0.145 0 0);
    --background: oklch(0.986 0.005 220);
    --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.567 0.117 220);
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.94 0.018 220);
    --secondary-foreground: oklch(0.32 0.08 220);
    --muted: oklch(0.97 0.005 220);
    --muted-foreground: oklch(0.50 0.025 220);
    --accent: oklch(0.93 0.025 220);
    --accent-foreground: oklch(0.32 0.08 220);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(1 0 0);
    --border: oklch(0.91 0.01 220);
    --input: oklch(0.91 0.01 220);
    --ring: oklch(0.567 0.117 220);
    /* Also override the compiled --color-* tokens Tailwind uses at runtime */
    --color-background: oklch(0.986 0.005 220);
    --color-foreground: oklch(0.145 0 0);
    --color-card: oklch(1 0 0);
    --color-card-foreground: oklch(0.145 0 0);
    --color-popover: oklch(1 0 0);
    --color-popover-foreground: oklch(0.145 0 0);
    --color-primary: oklch(0.567 0.117 220);
    --color-primary-foreground: oklch(1 0 0);
    --color-secondary: oklch(0.94 0.018 220);
    --color-secondary-foreground: oklch(0.32 0.08 220);
    --color-muted: oklch(0.97 0.005 220);
    --color-muted-foreground: oklch(0.50 0.025 220);
    --color-accent: oklch(0.93 0.025 220);
    --color-accent-foreground: oklch(0.32 0.08 220);
    --color-destructive: oklch(0.577 0.245 27.325);
    --color-destructive-foreground: oklch(1 0 0);
    --color-border: oklch(0.91 0.01 220);
    --color-input: oklch(0.91 0.01 220);
    --color-ring: oklch(0.567 0.117 220);
}

.theme-pelajar {
    --background: oklch(0.986 0.015 220);
    --card: #ffffff;
    --card-foreground: oklch(0.145 0 0);
    --primary: oklch(0.567 0.117 220);
    --primary-foreground: oklch(1 0 0);
    --border: oklch(0.91 0.02 220);
    --ring: oklch(0.567 0.117 220);
    --color-background: oklch(0.986 0.015 220);
    --color-card: #ffffff;
    --color-card-foreground: oklch(0.145 0 0);
    --color-primary: oklch(0.567 0.117 220);
    --color-border: oklch(0.91 0.02 220);
    --color-ring: oklch(0.567 0.117 220);
    --radius: 1.5rem;
    font-family: 'Quicksand', 'Instrument Sans', sans-serif !important;
}
.theme-pelajar .rounded-3xl {
    border-radius: 1.5rem !important;
}

.theme-profesional {
    --background: #fafaf9;
    --card: #ffffff;
    --card-foreground: #1c1917;
    --primary: #292524;
    --primary-foreground: #ffffff;
    --border: #e7e5e4;
    --ring: #292524;
    --color-background: #fafaf9;
    --color-card: #ffffff;
    --color-card-foreground: #1c1917;
    --color-primary: #292524;
    --color-border: #e7e5e4;
    --color-ring: #292524;
    --radius: 0.375rem;
    font-family: 'Inter', sans-serif !important;
}
.theme-profesional .rounded-3xl {
    border-radius: 0.5rem !important;
    box-shadow: none !important;
    border: 1px solid #e7e5e4 !important;
}
.theme-profesional .rounded-2xl {
    border-radius: 0.375rem !important;
}
.theme-profesional input,
.theme-profesional button,
.theme-profesional textarea,
.theme-profesional select {
    border-radius: 0.25rem !important;
}

.theme-pensiunan {
    --background: #f0fdf4;
    --card: #ffffff;
    --card-foreground: #14532d;
    --primary: #15803d;
    --primary-foreground: #ffffff;
    --border: #dcfce7;
    --ring: #15803d;
    --color-background: #f0fdf4;
    --color-card: #ffffff;
    --color-card-foreground: #14532d;
    --color-primary: #15803d;
    --color-border: #dcfce7;
    --color-ring: #15803d;
    --radius: 0.75rem;
    font-size: 1.05rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.theme-pensiunan .rounded-3xl {
    border-radius: 1rem !important;
}
.theme-pensiunan h1,
.theme-pensiunan .text-3xl {
    font-size: 2rem !important;
    line-height: 2.25rem !important;
}
.theme-pensiunan h2,
.theme-pensiunan .text-lg {
    font-size: 1.35rem !important;
    line-height: 1.6rem !important;
}
.theme-pensiunan p,
.theme-pensiunan .text-xs,
.theme-pensiunan .text-sm {
    font-size: 0.95rem !important;
    line-height: 1.5rem !important;
}
.theme-pensiunan label,
.theme-pensiunan input,
.theme-pensiunan button,
.theme-pensiunan textarea {
    font-size: 0.95rem !important;
}
.theme-pensiunan button {
    padding: 0.75rem 1.5rem !important;
    height: auto !important;
}
.theme-pensiunan input,
.theme-pensiunan textarea {
    padding: 0.75rem !important;
}

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

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

    button:not(:disabled),
    [role='button']:not(:disabled) {
        cursor: pointer;
    }
}

/* Specific overrides to prevent calendar/planner navigation buttons from being distorted in theme-pensiunan */
.theme-pensiunan button.calendar-nav-btn {
    padding: 0px !important;
    height: 2.25rem !important; /* 36px */
    width: 2.25rem !important; /* 36px */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.theme-pensiunan button.calendar-nav-btn-sm {
    padding: 0px !important;
    height: 2rem !important; /* 32px */
    width: 2rem !important; /* 32px */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

