/* ==========================================================================
   Discord Logs Panel - Design System (Discord & Linear Inspired Dark Theme)
   ========================================================================== */

:root {
  --bg-primary: #0e1015;
  --bg-secondary: #14171f;
  --bg-tertiary: #1b1f2b;
  --bg-card: rgba(22, 27, 36, 0.85);
  --bg-card-hover: rgba(30, 36, 48, 0.95);
  
  --discord-blurple: #5865F2;
  --discord-blurple-hover: #4752C4;
  --discord-green: #57F287;
  --discord-yellow: #FEE75C;
  --discord-fuchsia: #EB459E;
  --discord-red: #ED4245;

  --accent-glow: rgba(88, 101, 242, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(88, 101, 242, 0.6);

  --text-primary: #f2f3f5;
  --text-secondary: #949ba4;
  --text-muted: #6b7280;
  --text-link: #00a8fc;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(88, 101, 242, 0.35);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(88, 101, 242, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(87, 242, 135, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Header & Top Bar */
.top-nav {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 16, 21, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--discord-blurple), #7289da);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.auth-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Key Display Badge */
.key-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.copy-btn:hover {
  color: #fff;
}

/* Quota Indicator */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(87, 242, 135, 0.1);
  border: 1px solid rgba(87, 242, 135, 0.25);
  color: var(--discord-green);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--discord-green);
  box-shadow: 0 0 8px var(--discord-green);
}

.quota-low {
  background: rgba(237, 66, 69, 0.12);
  border-color: rgba(237, 66, 69, 0.3);
  color: var(--discord-red);
}

.quota-low .quota-dot {
  background: var(--discord-red);
  box-shadow: 0 0 8px var(--discord-red);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--discord-blurple);
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.3);
}

.btn-primary:hover {
  background: var(--discord-blurple-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero & Search Zone */
.hero-section {
  text-align: center;
  padding: 40px 0 30px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 550px;
  margin: 0 auto 30px;
}

.search-box-wrapper {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 6px 8px 6px 18px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--discord-blurple);
  box-shadow: var(--shadow-glow), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: 12px 24px;
  border-radius: var(--radius-lg);
}

/* PoW Calculation Badge */
.pow-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: #a5b4fc;
}

.pow-indicator.active {
  display: flex;
}

.pow-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(165, 180, 252, 0.2);
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Feedback & Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
}

.toast-error {
  border-color: rgba(237, 66, 69, 0.4);
  background: #23181b;
  color: #ff9496;
}

.toast-success {
  border-color: rgba(87, 242, 135, 0.4);
  background: #14231a;
  color: #94ffb2;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Discord Profile Card */
.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.profile-banner {
  height: 130px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--discord-blurple);
}

.profile-header-body {
  padding: 0 24px 20px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.profile-avatar-wrap {
  position: relative;
  margin-top: -50px;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 5px solid var(--bg-secondary);
  background-color: var(--bg-secondary);
  object-fit: cover;
  display: block;
}

.profile-info {
  flex: 1;
  padding-top: 10px;
}

.profile-names {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-global-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.profile-username {
  font-size: 14px;
  color: var(--text-secondary);
}

.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badges-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: #d1d5db;
}

/* Results Stats Bar */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.results-count strong {
  color: #fff;
}

.free-page-notice {
  font-size: 12px;
  color: var(--discord-green);
  background: rgba(87, 242, 135, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(87, 242, 135, 0.2);
}

/* Messages List */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: var(--transition);
  position: relative;
}

.message-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.message-reply-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--discord-blurple);
}

.reply-author {
  color: var(--text-secondary);
  font-weight: 600;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.message-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.channel-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
}

.message-date {
  font-size: 12px;
  color: var(--text-muted);
}

.message-content {
  font-size: 14.5px;
  line-height: 1.6;
  color: #dcddde;
  word-break: break-word;
}

/* Dynamic Media Embeds */
.media-embed {
  margin-top: 12px;
  display: inline-block;
  max-width: 100%;
}

.media-image-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: block;
  transition: var(--transition);
}

.media-image-btn:hover {
  border-color: var(--discord-blurple);
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.media-img-preview {
  max-width: 320px;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

.media-video-player {
  max-width: 480px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #000;
  outline: none;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 40px;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.page-info strong {
  color: #fff;
}

/* Modal Lightbox */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #202225;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: var(--discord-red);
}

/* Access Key Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.key-result-display {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-focus);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

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

footer a:hover {
  color: var(--discord-blurple);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .top-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .auth-status-bar {
    justify-content: space-between;
  }
  .hero-title {
    font-size: 24px;
  }
  .search-bar {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-lg);
  }
  .search-btn {
    width: 100%;
  }
  .profile-header-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-avatar-wrap {
    margin-top: -40px;
  }
  .profile-names {
    justify-content: center;
  }
  .profile-meta-row {
    justify-content: center;
  }
}
