/* EduClass — custom component styles (supplements Tailwind Play CDN) */

/* Base */
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
* { border-color: oklch(0.9 0.01 165); }

/* Custom scrollbar */
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: oklch(0.7 0.01 165); border-radius: 9999px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: oklch(0.52 0.13 165); }

/* Card */
.card { background: #fff; border: 1px solid var(--tw-border-color, oklch(0.9 0.01 165)); border-radius: 0.625rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid oklch(0.9 0.01 165); }
.card-content { padding: 1.25rem; }
.card-title { font-weight: 600; font-size: 1rem; }

/* Button base (shadcn-like) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 0.5rem; font-weight: 500; font-size: 0.875rem; padding: 0.5rem 1rem; transition: all 0.15s; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: oklch(0.52 0.13 165); color: oklch(0.99 0.005 160); }
.btn-primary:hover { background: oklch(0.45 0.13 165); }
.btn-outline { background: #fff; border-color: oklch(0.9 0.01 165); color: oklch(0.18 0.02 165); }
.btn-outline:hover { background: oklch(0.96 0.01 165); }
.btn-ghost { background: transparent; color: oklch(0.18 0.02 165); }
.btn-ghost:hover { background: oklch(0.96 0.01 165); }
.btn-destructive { background: oklch(0.577 0.245 27.325); color: #fff; }
.btn-destructive:hover { background: oklch(0.5 0.245 27.325); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.625rem 1.5rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; }

/* Input */
.input { width: 100%; border: 1px solid oklch(0.9 0.01 165); border-radius: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; background: #fff; transition: border-color 0.15s; }
.input:focus { outline: none; border-color: oklch(0.52 0.13 165); box-shadow: 0 0 0 3px oklch(0.52 0.13 165 / 0.1); }
.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.textarea { font-family: inherit; resize: vertical; min-height: 80px; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }

/* Tabs */
.tab-list { display: flex; border-bottom: 1px solid oklch(0.9 0.01 165); gap: 0.25rem; overflow-x: auto; }
.tab { padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; border: none; background: transparent; cursor: pointer; border-bottom: 2px solid transparent; color: oklch(0.5 0.02 165); white-space: nowrap; transition: all 0.15s; }
.tab:hover { color: oklch(0.18 0.02 165); }
.tab.active { color: oklch(0.52 0.13 165); border-bottom-color: oklch(0.52 0.13 165); }
.tab-content { padding-top: 1rem; }

/* Dialog (modal) */
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.dialog { background: #fff; border-radius: 0.75rem; max-width: 32rem; width: 100%; margin: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.dialog-header { padding: 1.25rem 1.5rem 0; }
.dialog-title { font-size: 1.125rem; font-weight: 600; }
.dialog-description { font-size: 0.875rem; color: oklch(0.5 0.02 165); margin-top: 0.25rem; }
.dialog-body { padding: 1rem 1.5rem; }
.dialog-footer { padding: 0 1.5rem 1.5rem; display: flex; justify-content: flex-end; gap: 0.5rem; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; }

/* Toast */
.toast { background: #fff; border: 1px solid oklch(0.9 0.01 165); border-radius: 0.5rem; padding: 0.75rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.1); min-width: 280px; max-width: 400px; font-size: 0.875rem; animation: toast-in 0.2s ease; }
.toast-success { border-left: 4px solid oklch(0.52 0.13 165); }
.toast-error { border-left: 4px solid oklch(0.577 0.245 27.325); }
.toast-info { border-left: 4px solid oklch(0.6 0.118 184.704); }
@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Status badges */
.status-PUBLISHED, .status-ACTIVE, .status-AVAILABLE, .status-COMPLETED, .status-PASSED, .status-APPROVED { background: #d1fae5; color: #047857; }
.status-DRAFT, .status-CANCELLED { background: #f3f4f6; color: #6b7280; }
.status-BOOKED, .status-SCHEDULED, .status-IN_PROGRESS, .status-PENDING, .status-UPCOMING { background: #fef3c7; color: #b45309; }
.status-FAILED, .status-REJECTED { background: #ffe4e6; color: #be123c; }
.status-LIVE { background: #fef3c7; color: #b45309; }

/* Role badges */
.role-ADMIN { background: oklch(0.52 0.13 165 / 0.1); color: oklch(0.52 0.13 165); }
.role-TEACHER { background: #ede9fe; color: #6d28d9; }
.role-STUDENT { background: #cffafe; color: #0e7490; }

/* Avatar */
.avatar { border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }

/* Sidebar nav button */
.nav-btn { width: 100%; display: flex; align-items: center; gap: 0.75rem; border-radius: 0.5rem; padding: 0.625rem 0.75rem; font-size: 0.875rem; font-weight: 500; transition: all 0.15s; text-align: left; border: none; cursor: pointer; background: transparent; color: inherit; }
.nav-btn:hover { background: oklch(0.94 0.04 165); }
.nav-btn.active { background: oklch(0.52 0.13 165); color: oklch(0.99 0.005 160); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Skeleton */
.skeleton { background: oklch(0.96 0.01 165); border-radius: 0.5rem; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1rem; }

/* Dark mode (basic) */
.dark body { background: oklch(0.16 0.01 165); color: oklch(0.985 0 0); }
.dark .card, .dark .dialog { background: oklch(0.21 0.012 165); }
.dark .input { background: oklch(0.21 0.012 165); border-color: rgba(255,255,255,0.1); color: #fff; }
.dark .btn-outline { background: oklch(0.21 0.012 165); border-color: rgba(255,255,255,0.1); color: #fff; }
.dark .btn-outline:hover { background: oklch(0.27 0.015 165); }

/* Print (for certificates) */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}
