/* ========================================
   Giants — Design System & Global Styles
   ======================================== */

:root {
  --color-primary: #6C5CE7;
  --color-primary-light: #A29BFE;
  --color-primary-dark: #5A4BD1;
  --color-accent: #00D4FF;
  --color-green: #00FF88;
  --color-success: #00B894;
  --color-warning: #FDCB6E;
  --color-danger: #FF6B6B;
  --color-orange: #FF9F43;

  --color-bg: #0A0A1A;
  --color-bg-card: #12122A;
  --color-bg-elevated: #1A1A3E;
  --color-bg-hover: #222250;
  --color-border: #2A2A50;
  --color-border-light: #3A3A60;

  --color-text: #FFFFFF;
  --color-text-secondary: #B0B0D0;
  --color-text-muted: #6E6E8A;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(108,92,231,0.15);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  --sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 10px 24px; border-radius: var(--radius-full); font-weight: 600; font-size: 14px;
  transition: all var(--transition-normal); border: none; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); color: #fff; box-shadow: 0 4px 20px rgba(108,92,231,0.3); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(108,92,231,0.5); }
.btn--ghost { background: transparent; color: var(--color-text); border: 1px solid var(--color-border-light); }
.btn--ghost:hover { background: var(--color-bg-elevated); border-color: var(--color-primary); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { opacity: 0.9; }
.btn--success { background: var(--color-success); color: #fff; }
.btn--warning { background: var(--color-warning); color: #000; }
.btn--sm { padding: 6px 16px; font-size: 13px; }
.btn--lg { padding: 14px 32px; font-size: 16px; }

/* Flash */
.flash {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  padding: 14px 24px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  animation: flashIn 0.3s ease; max-width: 400px;
}
.flash--notice { background: var(--color-primary); color: #fff; }
.flash--alert { background: var(--color-danger); color: #fff; }
@keyframes flashIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* App Layout */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width); background: var(--color-bg-card); border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 24px;
  font-weight: 800; font-size: 20px; border-bottom: 1px solid var(--color-border);
}
.sidebar__logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #fff;
}
.sidebar__nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
  color: var(--color-text-secondary); transition: all var(--transition-fast);
}
.sidebar__link:hover { background: var(--color-bg-hover); color: var(--color-text); }
.sidebar__link--active { background: rgba(108,92,231,0.15); color: var(--color-primary-light); font-weight: 600; }
.sidebar__link--logout { color: var(--color-danger); }
.sidebar__link-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar__divider { height: 1px; background: var(--color-border); margin: 12px 0; }
.sidebar__footer { padding: 16px 24px; border-top: 1px solid var(--color-border); }
.sidebar__user { margin-bottom: 8px; }
.sidebar__user-name { font-size: 14px; font-weight: 600; color: var(--color-text); }

/* Main Content */
.main-content { margin-left: var(--sidebar-width); flex: 1; padding: 32px; min-height: 100vh; }

/* Auth pages */
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side {
  background: linear-gradient(135deg, rgba(108,92,231,0.12), rgba(0,212,255,0.08)), var(--color-bg);
  display: flex; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden;
}
.auth-side::before {
  content: ''; position: absolute; top: -50%; right: -30%; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.1) 0%, transparent 70%); animation: authFloat 20s ease-in-out infinite;
}
@keyframes authFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -20px); } }
.auth-side__content { position: relative; z-index: 1; max-width: 440px; }
.auth-side__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; font-size: 22px; font-weight: 800; }
.auth-side__logo {
  width: 40px; height: 40px; background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px;
}
.auth-side__title { font-size: 40px; font-weight: 900; line-height: 1.15; margin-bottom: 20px; }
.auth-side__title-highlight {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-side__subtitle { font-size: 16px; color: var(--color-text-secondary); line-height: 1.7; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2, .auth-card .auth-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.auth-card .auth-subtitle { font-size: 15px; color: var(--color-text-secondary); margin-bottom: 32px; }
.auth-field { margin-bottom: 20px; }
.auth-field label { display: block; font-size: 14px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; }
.auth-field input[type="text"], .auth-field input[type="email"], .auth-field input[type="password"] {
  width: 100%; padding: 14px 16px; background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); color: var(--color-text); font-size: 15px; transition: all var(--transition-fast); outline: none;
}
.auth-field input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.15); }
.auth-field input::placeholder { color: var(--color-text-muted); }
.auth-field--check { display: flex; align-items: center; gap: 10px; }
.auth-field--check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-primary); }
.auth-field--check label { margin-bottom: 0; font-weight: 400; }
.auth-submit {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all var(--transition-normal); margin-top: 8px;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,92,231,0.4); }
.auth-links { margin-top: 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.auth-links a { font-size: 14px; color: var(--color-text-muted); transition: color var(--transition-fast); }
.auth-links a:hover { color: var(--color-primary); }
.auth-errors { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.2); border-radius: var(--radius-md); padding: 16px; margin-bottom: 24px; }
.auth-errors h3 { font-size: 14px; font-weight: 600; color: var(--color-danger); margin-bottom: 8px; }
.auth-errors ul { list-style: none; }
.auth-errors li { font-size: 13px; color: var(--color-danger); padding: 2px 0; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}
