:root {
  --background: 0 0% 3.9%;
  --foreground: 0 0% 98%;
  --card: 0 0% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary: 0 0% 14.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --accent: 0 0% 14.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 14.9%;
  --input: 0 0% 14.9%;
  --ring: 0 0% 83.9%;
  --success: 142.1 70.6% 45.3%;
  --discord: 235 86% 65%;
  --warning: 38 92% 50%;
  --radius: 0.5rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

.dashboard-header {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, hsl(var(--primary)), #999, hsl(var(--primary)));
  background-size: 300% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite;
  white-space: nowrap;
  flex-grow: 1;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.dashboard-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* Buttons container using existing buttons but modernized */
.dashboard-header .logout-button,
.dashboard-header .forum-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.dashboard-header .logout-button:hover,
.dashboard-header .forum-button:hover {
  background-color: hsl(var(--accent));
  transform: translateY(-2px);
}

.dashboard-header .logout-button svg,
.dashboard-header .forum-button svg {
  width: 1rem;
  height: 1rem;
}

.dashboard-container {
  width: 100%;
  max-width: 800px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .dashboard-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .full-width {
    grid-column: span 2;
  }
}

.card {
  width: 100%;
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: card-appear 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, hsl(var(--primary)), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::after {
  opacity: 1;
}

@keyframes card-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  width: 1.25rem;
  height: 1.25rem;
}

.card-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  background-color: hsl(var(--success));
  color: hsl(var(--foreground));
}

.card-badge.not-connected {
  background-color: hsl(var(--muted));
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(var(--border));
  transition: transform 0.3s;
}

.profile-avatar:hover {
  transform: scale(1.1);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-id {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.button:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.button svg {
  width: 1rem;
  height: 1rem;
}

.button-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
}

.button-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button-discord {
  background-color: hsl(var(--discord));
  color: hsl(var(--foreground));
  border: none;
}

.button-discord:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border: none;
}

.button-destructive:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button-outline {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--primary));
}

.button-outline:hover {
  background-color: hsl(var(--accent));
  transform: translateY(-1px);
}

.button-success {
  background-color: hsl(var(--success));
  color: hsl(var(--foreground));
  border: none;
}

.button-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer {
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
  width: 100%;
  max-width: 800px;
}

.footer a {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.footer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* API Key styles */
.api-key-container {
  margin-top: 1rem;
}

.api-key-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.api-key-item {
  background-color: hsl(var(--secondary));
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.api-key-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.api-key-name {
  font-weight: 500;
}

.api-key-value {
  font-family: monospace;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--background));
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-actions {
  display: flex;
  gap: 0.5rem;
}

.api-key-action {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
}

.api-key-action:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

.api-key-action svg {
  width: 1rem;
  height: 1rem;
}

.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.input {
  width: 100%;
  padding: 0.75rem;
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: hsl(var(--ring));
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.empty-state {
  text-align: center;
  padding: 2rem 0;
  color: hsl(var(--muted-foreground));
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 300px;
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  text-align: left;
  border-radius: var(--radius);
  padding: 0.75rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-90%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  border: 1px solid hsl(var(--border));
  line-height: 1.4;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 85%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: hsl(var(--border)) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Documentation link */
.docs-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  font-size: 0.875rem;
  transition: opacity 0.15s ease;
}

.docs-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.docs-link svg {
  width: 1rem;
  height: 1rem;
}

/* Loading spinner */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--muted-foreground));
  border-top-color: hsl(var(--foreground));
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Custom SweetAlert styling */
.swal2-popup {
  background-color: hsl(var(--card)) !important;
  color: hsl(var(--card-foreground)) !important;
  border: 1px solid hsl(var(--border)) !important;
  font-family: var(--font-sans) !important;
}

.swal2-title,
.swal2-html-container,
.swal2-confirm,
.swal2-cancel {
  font-family: var(--font-sans) !important;
}

.swal2-title {
  color: hsl(var(--card-foreground)) !important;
}

.swal2-html-container {
  color: hsl(var(--card-foreground)) !important;
}

.swal2-confirm {
  background-color: hsl(var(--primary)) !important;
  color: hsl(var(--primary-foreground)) !important;
}

.swal2-cancel {
  background-color: transparent !important;
  color: hsl(var(--primary)) !important;
  border: 1px solid hsl(var(--border)) !important;
}

.swal2-icon.swal2-warning {
  border-color: hsl(var(--warning)) !important;
  color: hsl(var(--warning)) !important;
}

.swal2-icon.swal2-success {
  border-color: hsl(var(--success)) !important;
  color: hsl(var(--success)) !important;
}