/* ── SantanaRP Ticket Viewer ─────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-tertiary: #1e1f22;
  --bg-floating: #383a40;
  --bg-input: #1e1f22;
  --border: #3f4147;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --red: #da373c;
  --green: #23a55a;
  --text-normal: #dbdee1;
  --text-muted: #949ba4;
  --text-faint: #6d6f78;
  --white: #f2f3f5;
  --radius: 8px;
  --radius-sm: 4px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-tertiary);
  color: var(--text-normal);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ──────────────────────────────────────────────── */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo .logo-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
}

.login-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.login-form {
  margin-top: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus {
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: var(--text-faint);
}

.submit-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.submit-btn:hover {
  background: var(--accent-hover);
}

.error {
  background: rgba(218, 55, 60, 0.12);
  border: 1px solid rgba(218, 55, 60, 0.4);
  color: #f38688;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.footer-text {
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 20px;
}

/* ── Transcript Page ─────────────────────────────────────────── */

.transcript-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px;
}

.transcript-header {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.transcript-header .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.transcript-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.transcript-header .uid-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.meta-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.meta-item .label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-faint);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.meta-item .value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-normal);
}

.back-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}

.back-btn:hover {
  color: var(--text-normal);
  border-color: var(--text-muted);
}

/* ── Messages ────────────────────────────────────────────────── */

.messages-container {
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.messages-title {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.messages-list {
  padding: 4px 0;
}

.message {
  display: flex;
  padding: 8px 16px;
  gap: 12px;
}

.message:hover {
  background: var(--bg-secondary);
}

.message.bot {
  background: rgba(88, 101, 242, 0.04);
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  margin-top: 2px;
}

.message .msg-content {
  flex: 1;
  min-width: 0;
}

.message .msg-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 1px;
}

.message .author {
  font-weight: 600;
  font-size: 14px;
}

.message .bot-badge {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 2px;
}

.message .timestamp {
  color: var(--text-faint);
  font-size: 11px;
}

.message .msg-body {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-normal);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message .msg-body a {
  color: #00a8fc;
  text-decoration: none;
}

.message .msg-body a:hover {
  text-decoration: underline;
}

/* Attachments */
.message .attachment {
  margin-top: 6px;
}

.message .attachment img {
  max-width: 350px;
  max-height: 250px;
  border-radius: var(--radius-sm);
}

.message .attachment a {
  color: #00a8fc;
  text-decoration: none;
  font-size: 14px;
}

.message .attachment a:hover {
  text-decoration: underline;
}

/* Embeds */
.message .embed-block {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
}

.message .embed-block strong {
  color: var(--white);
}

.message .embed-block p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .login-card {
    padding: 24px 20px;
  }

  .transcript-header {
    padding: 16px;
  }

  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .message {
    padding: 8px 12px;
    gap: 8px;
  }

  .message .avatar {
    width: 28px;
    height: 28px;
  }

  .transcript-header h1 {
    font-size: 16px;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start !important;
  }
}
