/* ============================================
   Rinet AI — Global Stylesheet
   Premium design inspired by atoms.dev
   ============================================ */

/* ===== DARK THEME (default) ===== */
:root {
  --bg: #0c0c10;
  --bg-secondary: #111116;
  --bg-card: #17171e;
  --bg-elevated: #1e1e28;
  --border: #2c2c3a;
  --border-subtle: #1e1e28;
  --text: #e8e8f2;
  --text-muted: #6b6b84;
  --text-dim: #3a3a50;
  --accent: #5b6af0;
  --accent-dim: #4050d0;
  --accent-glow: rgba(91,106,240,0.14);
  --accent-2: #00d4ff;
  --success: #00c896;
  --error: #ff4d6a;
  --warning: #ffb347;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow: 0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.55);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono','Fira Code','Cascadia Code',monospace;
  --transition: 0.16s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w: 260px;
  --header-h: 52px;
}

/* ===== PREMIUM WHITE (atoms.dev-inspired) ===== */
[data-theme="white"] {
  --bg: #ffffff;
  --bg-secondary: #f7f7f9;
  --bg-card: #ffffff;
  --bg-elevated: #f0f0f4;
  --border: #e4e4ec;
  --border-subtle: #ececf2;
  --text: #111118;
  --text-muted: #6b6b84;
  --text-dim: #b0b0c0;
  --accent: #5b6af0;
  --accent-dim: #4050d0;
  --accent-glow: rgba(91,106,240,0.08);
  --accent-2: #00a8e8;
  --success: #00a878;
  --error: #e03050;
  --warning: #d97706;
  --shadow: 0 1px 8px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.10);
}

/* ===== LIGHT (soft) ===== */
[data-theme="light"] {
  --bg: #f4f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ebebf2;
  --border: #dddde8;
  --border-subtle: #e8e8f0;
  --text: #1a1a2e;
  --text-muted: #6b6b80;
  --text-dim: #b0b0c0;
  --accent: #5b6af0;
  --accent-glow: rgba(91,106,240,0.09);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 6px 30px rgba(0,0,0,0.1);
}

/* ===== BLUE ===== */
[data-theme="blue"] {
  --bg: #050c18;
  --bg-secondary: #091525;
  --bg-card: #0d1d35;
  --bg-elevated: #102040;
  --border: #1a3055;
  --border-subtle: #122040;
  --accent: #00a8ff;
  --accent-dim: #0088dd;
  --accent-glow: rgba(0,168,255,0.14);
  --text: #d0eaff;
  --text-muted: #6090b0;
  --text-dim: #2a4060;
}

/* ===== GREEN ===== */
[data-theme="green"] {
  --bg: #050f08;
  --bg-secondary: #091a0e;
  --bg-card: #0d2014;
  --bg-elevated: #102a1c;
  --border: #1a3826;
  --border-subtle: #122a1a;
  --accent: #00c87a;
  --accent-dim: #00a060;
  --accent-glow: rgba(0,200,122,0.14);
  --text: #c0f0d8;
  --text-muted: #509070;
  --text-dim: #203828;
}

/* ===== PURPLE ===== */
[data-theme="purple"] {
  --bg: #08040e;
  --bg-secondary: #100818;
  --bg-card: #160d22;
  --bg-elevated: #1e1030;
  --border: #2c1850;
  --border-subtle: #1c1038;
  --accent: #b060f0;
  --accent-dim: #9040d0;
  --accent-glow: rgba(176,96,240,0.14);
  --text: #e8d0ff;
  --text-muted: #806090;
  --text-dim: #301840;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; transition: background 0.25s, color 0.25s; }

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { opacity: 0.8; }

/* ===== WHITE THEME SPECIAL OVERRIDES ===== */
[data-theme="white"] ::-webkit-scrollbar-thumb { background: #d0d0dc; }
[data-theme="white"] .chat-sidebar,
[data-theme="white"] .sandbox-left { background: #f7f7f9; border-right-color: #e4e4ec; }
[data-theme="white"] .chat-topbar,
[data-theme="white"] .sandbox-topbar { background: #ffffff; border-bottom-color: #e8e8f0; box-shadow: 0 1px 0 #e8e8f0; }
[data-theme="white"] .chat-input-area { background: #ffffff; border-top-color: #e8e8f0; }
[data-theme="white"] .chat-input-wrapper { background: #f7f7f9; border-color: #dddde8; }
[data-theme="white"] .chat-input-wrapper:focus-within { border-color: #5b6af0; box-shadow: 0 0 0 3px rgba(91,106,240,0.1); }
[data-theme="white"] .message-content { background: #f7f7f9; border-color: #e4e4ec; }
[data-theme="white"] .message.user .message-content { background: #eef0fe; border-color: #c5c9f8; color: #2a33b0; }
[data-theme="white"] .message-content pre { background: #1e1e2e; color: #cdd6f4; }
[data-theme="white"] .message-content code:not(pre code) { background: #eef0fe; color: #4050d0; }
[data-theme="white"] .session-item:hover { background: #ebebf2; }
[data-theme="white"] .session-item.active { background: #eef0fe; color: #4050d0; }
[data-theme="white"] .sidebar-item:hover { background: #ebebf2; }
[data-theme="white"] .sidebar-item.active { background: #eef0fe; color: #4050d0; }
[data-theme="white"] .model-select { background: #f0f0f4; border-color: #dddde8; color: #4a4a60; }
[data-theme="white"] .topbar-btn:hover { background: #ebebf2; }
[data-theme="white"] .logo-mark { box-shadow: 0 2px 8px rgba(91,106,240,0.3); }
[data-theme="white"] .terminal-body { background: #1a1a2a; color: #e0e0f0; }
[data-theme="white"] .tree-item:hover { background: #ebebf2; }
[data-theme="white"] .tree-item.active { background: #eef0fe; color: #4050d0; }
[data-theme="white"] .filter-chip:hover,
[data-theme="white"] .filter-chip.active { background: #eef0fe; border-color: #c5c9f8; color: #4050d0; }
[data-theme="white"] .feature-card { border-color: #e4e4ec; }
[data-theme="white"] .feature-card:hover { border-color: #5b6af0; box-shadow: 0 4px 20px rgba(91,106,240,0.1); }
[data-theme="white"] .btn-secondary { background: #f0f0f4; border-color: #dddde8; }
[data-theme="white"] .btn-secondary:hover { border-color: #5b6af0; color: #5b6af0; background: #eef0fe; }
[data-theme="white"] .topbar-logo { color: #111118; }
[data-theme="white"] .hero h1 { background: linear-gradient(135deg, #111118 0%, #4050d0 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="white"] .hero-badge { background: #f0f0f6; border-color: #dddde8; }
[data-theme="white"] .card { border-color: #e4e4ec; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
[data-theme="white"] .card:hover { box-shadow: 0 4px 16px rgba(91,106,240,0.1); border-color: #c5c9f8; }
[data-theme="white"] .input { background: #f7f7f9; border-color: #dddde8; }
[data-theme="white"] .input:focus { border-color: #5b6af0; background: #fff; }
[data-theme="white"] .toast { background: #ffffff; border-color: #e4e4ec; box-shadow: 0 4px 20px rgba(0,0,0,0.10); }
[data-theme="white"] .toast.success { border-color: #00c896; }
[data-theme="white"] .toast.error { border-color: #e03050; }
[data-theme="white"] .code-textarea { background: #fafafa; }
[data-theme="white"] .line-numbers { background: #f5f5f8; border-right-color: #e4e4ec; color: #b0b0c0; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); background: var(--bg-secondary); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; transition: width var(--transition); }
.sidebar.collapsed { width: 0; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ===== TOP BAR ===== */
.topbar { height: var(--header-h); background: var(--bg-secondary); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; padding: 0 16px; gap: 10px; flex-shrink: 0; }
.topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.3px; }
.logo-mark { width: 28px; height: 28px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0; }
.topbar-spacer { flex: 1; }
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-btn { padding: 5px 10px; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all var(--transition); font-family: var(--font); display: flex; align-items: center; gap: 6px; }
.topbar-btn:hover { background: var(--bg-elevated); color: var(--text); }
.topbar-btn.active { color: var(--text); background: var(--bg-elevated); }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 7px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ===== SIDEBAR CONTENT ===== */
.sidebar-header { padding: 12px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }
.chat-sidebar-header { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }
.sidebar-section { padding: 8px; }
.sidebar-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); padding: 8px 8px 4px; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); font-size: 13px; color: var(--text-muted); border: none; background: none; width: 100%; text-align: left; }
.sidebar-item:hover { background: var(--bg-elevated); color: var(--text); }
.sidebar-item.active { background: var(--accent-glow); color: var(--accent); }
.sidebar-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== CARDS ===== */
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; transition: all var(--transition); }
.card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-accent { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); }
.badge-success { background: rgba(0,200,150,0.1); color: var(--success); }
.badge-muted { background: var(--bg-elevated); color: var(--text-muted); }

/* ===== INPUTS ===== */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.input { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 13px; padding: 10px 14px; width: 100%; transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--text-dim); }

/* ===== CHAT UI ===== */
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.message { display: flex; gap: 12px; animation: fadeSlideIn 0.2s ease; }
.message.assistant { flex-direction: row; }
.message.user { flex-direction: row-reverse; }
.message-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.message.assistant .message-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.message.user .message-avatar { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); }
.message-content { max-width: 76%; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 14px; line-height: 1.75; }
.message.user .message-content { background: var(--accent-glow); border-color: var(--accent); }
.message-content p { margin: 6px 0; }
.message-content p:first-child { margin-top: 0; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h1,.message-content h2,.message-content h3 { font-weight: 700; margin: 12px 0 6px; }
.message-content ul,.message-content ol { padding-left: 20px; margin: 6px 0; }
.message-content li { margin: 2px 0; }
.message-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.message-content th,.message-content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.message-content th { background: var(--bg-elevated); font-weight: 600; }
.message-content blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-muted); margin: 8px 0; font-style: italic; }
.message-content pre { margin: 10px 0; border-radius: var(--radius); overflow: hidden; }
.message-content code:not(pre code) { font-family: var(--font-mono); font-size: 12px; background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; color: var(--accent); }
.message-content pre code { font-family: var(--font-mono); font-size: 12px; }
.code-block-wrapper { position: relative; margin: 10px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.code-block-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: #1a1a2a; font-size: 11px; color: #8090a8; font-family: var(--font-mono); }
.code-block-wrapper pre { margin: 0 !important; border-radius: 0 !important; border: none !important; }
.copy-btn { padding: 3px 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; font-size: 10px; cursor: pointer; color: #8090a8; transition: all var(--transition); font-family: var(--font); }
.copy-btn:hover { color: #fff; background: rgba(255,255,255,0.14); }

.chat-input-area { padding: 14px 20px; background: var(--bg-secondary); border-top: 1px solid var(--border-subtle); }
.chat-input-wrapper { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--transition), box-shadow var(--transition); }
.chat-input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.chat-textarea { width: 100%; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--font); font-size: 14px; padding: 14px 16px; resize: none; min-height: 52px; max-height: 200px; }
.chat-textarea::placeholder { color: var(--text-dim); }
.chat-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border-subtle); }
.chat-toolbar-spacer { flex: 1; }
.model-select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 12px; padding: 4px 10px; cursor: pointer; outline: none; font-family: var(--font); transition: border-color var(--transition); }
.model-select:focus { border-color: var(--accent); }

/* ===== SANDBOX ===== */
.terminal-line { line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.terminal-line.stdout { color: var(--text); }
.terminal-line.stderr { color: var(--error); }
.terminal-line.info { color: var(--accent); }
.terminal-line.exit { color: var(--text-muted); font-style: italic; }

/* ===== HOME PAGE ===== */
.hero { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 88vh; text-align: center; padding: 80px 24px; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-glow), transparent 65%); pointer-events: none; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 28px; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: pulse 2s ease infinite; }
.hero h1 { font-size: clamp(32px, 5.5vw, 68px); font-weight: 800; letter-spacing: -2px; line-height: 1.1; margin-bottom: 24px; background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero h1 .accent { -webkit-text-fill-color: var(--accent); }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 540px; line-height: 1.8; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding: 0 24px 80px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; transition: all var(--transition); }
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon { width: 40px; height: 40px; background: var(--accent-glow); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--accent); }
.feature-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ===== DISCOVER ===== */
.discover-header { padding: 28px 24px 14px; border-bottom: 1px solid var(--border-subtle); }
.discover-filters { display: flex; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
.filter-chip { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; transition: all var(--transition); font-family: var(--font); white-space: nowrap; }
.filter-chip:hover, .filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.discover-content { padding: 24px; overflow-y: auto; }

/* ===== THEME PICKER ===== */
.theme-picker { display: flex; gap: 6px; align-items: center; }
.theme-dot { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); }
.theme-dot:hover, .theme-dot.active { border-color: var(--text); transform: scale(1.25); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; animation: fadeIn 0.15s ease; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 480px; padding: 28px; box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ===== TOASTS ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 16px; font-size: 13px; box-shadow: var(--shadow); animation: slideInRight 0.2s ease; display: flex; align-items: center; gap: 8px; max-width: 320px; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.info { border-color: var(--accent); }

/* ===== TYPING INDICATOR ===== */
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: typingBounce 1s ease infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* ===== DIVIDER ===== */
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12px; margin: 12px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== LOADING ===== */
.skeleton { background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.w-full { width: 100%; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes themeSwitch { 0% { opacity: 0; transform: scale(0.98); } 100% { opacity: 1; transform: scale(1); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .chat-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform var(--transition); }
  .chat-sidebar.open { transform: translateX(0); }
  .chat-messages { padding: 14px; gap: 14px; }
  .message-content { max-width: 92%; }
  .hero h1 { font-size: 32px; letter-spacing: -1px; }
  .hero p { font-size: 16px; }
  .features-grid { grid-template-columns: 1fr; }
}

/* ===== PRINT (for PDF export) ===== */
@media print {
  .chat-sidebar, .chat-topbar, .chat-input-area, .token-stats-bar,
  .compare-banner, #toast-container, .copy-btn, .topbar-btn { display: none !important; }
  .chat-messages { height: auto !important; overflow: visible !important; padding: 0 !important; }
  .message { page-break-inside: avoid; }
  body { background: #fff !important; color: #000 !important; }
  .message-content { border: 1px solid #ddd !important; background: #f9f9f9 !important; }
  .message.user .message-content { background: #eef !important; }
}
