@layer theme, base, components;

@import './components/css/badge.css';
@import './components/css/button.css';
@import './components/css/input.css';
@import './components/css/separator.css';
@import './components/css/tabs.css';

@layer theme {
  :root {
    color-scheme: dark;

    --background: #0C0C0E;
    --foreground: #F3F4F6;
    --card: #131317;
    --card-foreground: #F3F4F6;
    --popover: #121215;
    --popover-foreground: #F3F4F6;
    --primary: #8B6CF6;
    --primary-foreground: #0C0C0E;
    --secondary: #19191D;
    --secondary-foreground: #F3F4F6;
    --muted: #121215;
    --muted-foreground: #9CA3AF;
    --accent: #212126;
    --accent-foreground: #F3F4F6;
    --destructive: #EF4444;
    --border: #1F1F25;
    --input: #1F1F25;
    --ring: #9B7BF7;

    --radius: 0.25rem;
    --radius-xs: 0.125rem;
    --radius-sm: 0.1875rem;
    --radius-md: 0.25rem;
    --radius-lg: 0.375rem;
    --radius-xl: 0.5rem;
    --radius-full: 9999px;

    --spacing: 0.25rem;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);

    --duration-fast: 80ms;
    --duration-normal: 120ms;
    --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  }
}

@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    outline: none;
    padding: 0;
  }

  body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    -webkit-font-smoothing: antialiased;
  }
}

@layer components {
  main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 2rem auto 0;
    max-width: 420px;
    width: 100%;
  }

  h1 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  h2 {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  #content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  header, .rowSetting, #sessionList li {
    align-items: center;
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  #statusText {
    color: var(--muted-foreground);
    font-size: 0.75rem;
  }

  section, form, #viewHome, #viewAccount {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  #formSend {
    flex-direction: row;
  }

  #formSend .input {
    flex: 1;
  }

  .auth-switch {
    align-items: center;
    color: var(--muted-foreground);
    display: flex;
    font-size: 0.8125rem;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.75rem;
  }

  [hidden] {
    display: none !important;
  }

  .rowSetting {
    min-height: 2.25rem;
    padding: 0.35rem 0;
  }

  .rowSetting + .rowSetting,
  #sessionList li + li {
    border-top: 1px solid var(--border);
  }

  .rowSetting > span {
    color: var(--foreground);
    font-size: 0.8125rem;
  }

  ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    width: 100%;
  }

  #textList {
    gap: 0.5rem;
    margin-top: 0.25rem;
  }

  #textList li {
    align-items: center;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    font-size: 0.8125rem;
    justify-content: space-between;
    min-height: 2rem;
    padding: 0.35rem 0.625rem;
    width: 100%;
  }

  #textList li span {
    flex: 1;
  }

  #sessionList {
    margin-top: 0.25rem;
  }

  #sessionList li {
    min-height: 2.5rem;
    padding: 0.35rem 0;
  }

  .session-slot {
    align-items: center;
    display: flex;
    gap: 0.5rem;
  }

  #sessionList li span,
  #codeDisplay,
  #currentSession {
    font-family: var(--font-mono);
  }

  #sessionList li span,
  #currentSession {
    color: var(--foreground);
    font-size: 0.8125rem;
  }

  #boxCode {
    align-items: center;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: inline-flex;
    gap: 0.5rem;
    min-height: 1.85rem;
    padding: 0.2rem 0.5rem;
  }

  #codeDisplay {
    color: var(--foreground);
    font-size: 0.75rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #btnCopy {
    width: 3.5rem;
    padding: 0;
    justify-content: center;
  }

  @media (max-width: 480px) {
    body, main {
      padding: 0.5rem;
    }
  }
}
