/*
 * MISSAV-J — CSS Reset, Typography, & Theme Tokens (Optimized)
 * Mengatur variabel global (Light & Dark dengan glassmorphism), font, scrollbar, dan reset.
 */

:root {
  /* Default Theme: YouTube Dark Palette */
  --color-bg: #0f0f0f;
  --color-surface: #1f1f1f;
  --color-surface-2: #282828;
  --color-surface-3: #3d3d3d;
  --color-border: #3d3d3d;
  --color-text: #f1f1f1;
  --color-text-muted: #aaaaaa;
  --color-text-faint: #717171;
  --color-accent: #ff527b;          /* MISSAV-J Premium Hot Pink */
  --color-accent-hover: #d83a60;
  --color-accent-soft: rgba(255, 82, 123, 0.15);
  --color-blue: #3ea6ff;            /* Link color */
  --color-success: #4caf50;
  --color-warning: #ffb300;

  /* Glassmorphism Styles (Dark mode) */
  --glass-bg: rgba(15, 15, 15, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);

  /* Fluid type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Sidebar sizes */
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;
  --header-height: 56px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Shadows */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.7);
}

/* Light Theme overrides */
:root[data-theme="light"] {
  --color-bg: #f9f9f9;
  --color-surface: #ffffff;
  --color-surface-2: #f1f1f1;
  --color-surface-3: #e5e5e5;
  --color-border: #e0e0e0;
  --color-text: #0f0f0f;
  --color-text-muted: #606060;
  --color-text-faint: #909090;
  --color-accent: #ff527b;
  --color-accent-hover: #d83a60;
  --color-accent-soft: rgba(255, 82, 123, 0.08);
  --color-blue: #065fd4;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Glassmorphism Styles (Light mode) */
  --glass-bg: rgba(249, 249, 249, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-blur: blur(12px);
}

/* Core reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--text-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
  line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  text-decoration: underline;
}

/* Interactive elements */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

input:focus, select:focus, textarea:focus {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

iframe {
  border: none;
}

/* Global utility classes */
.hidden {
  display: none !important;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
