/* Tijdra Custom Styles — complements Tailwind CDN */

/* ── Fonts ────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
    --color-tijdra-600: #4f46e5;
    --color-tijdra-700: #4338ca;
    --sidebar-width: 256px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Number font ───────────────────────────────────────────────────────────── */
.font-mono, code, pre, .tabular-nums {
    font-family: 'DM Mono', 'Fira Code', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
.scrollbar-thin::-webkit-scrollbar { width: 4px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

* { scrollbar-width: thin; scrollbar-color: #374151 transparent; }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }

/* ── Skeleton loader ───────────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* ── Timer flip animation ──────────────────────────────────────────────────── */
@keyframes flip {
    0%   { transform: rotateX(0deg); }
    50%  { transform: rotateX(-90deg); }
    100% { transform: rotateX(0deg); }
}

.timer-digit { display: inline-block; min-width: 1ch; }
.timer-digit.changing { animation: flip 0.2s ease; }

/* ── Focus styles ──────────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-tijdra-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
input[type="checkbox"]:checked { background-color: var(--color-tijdra-600); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
}

/* ── Card hover ────────────────────────────────────────────────────────────── */
.card-hover {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: 0 8px 24px -4px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* ── Status badges ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ── Table ─────────────────────────────────────────────────────────────────── */
.tijdra-table { width: 100%; border-collapse: collapse; }
.tijdra-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.tijdra-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.tijdra-table tr:hover td { background: #fafafa; }

/* ── Print styles ──────────────────────────────────────────────────────────── */
@media print {
    .no-print, nav, aside, header, footer, button { display: none !important; }
    body { background: white !important; padding: 0 !important; margin: 0 !important; }
    main { padding: 0 !important; margin: 0 !important; }
    a { color: inherit; text-decoration: none; }
    .print-break { page-break-before: always; }
}

/* ── Mobile bottom sheet ───────────────────────────────────────────────────── */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 60;
    max-height: 90vh;
    overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 4px;
    margin: 12px auto 0;
}

/* ── [x-cloak] hide before Alpine init ────────────────────────────────────── */
[x-cloak] { display: none !important; }
