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

:root {
  --bg-main: #1E1F22;
  --bg-sidebar: #2B2D31;
  --bg-card: #2B2D31;
  --bg-card-hover: #313338;
  --bg-input: #1E1F22;
  --accent: #5865F2;
  --accent-hover: #4752C4;
  --success: #23A559;
  --danger: #DA373C;
  --danger-hover: #A12828;
  --text-main: #DBDEE1;
  --text-header: #FFFFFF;
  --text-muted: #949BA4;
  --border-color: rgba(255, 255, 255, 0.05);
  --border-focus: rgba(255, 255, 255, 0.2);
  --radius: 12px;
  --radius-card: 16px;
  --radius-button: 8px;
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.25);
  --header-height: 72px;
  --sidebar-width: 260px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-header);
  font-weight: 700;
}

/* Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.container-narrow {
  max-width: 1000px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: var(--header-height);
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-header);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.avatar:hover {
  border-color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-button);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-header);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

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

/* Hero Section */
.hero {
  text-align: center;
  padding: 6rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.15) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-inline: auto;
}

/* Grid & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Server Selection Cards */
.server-card {
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  padding: 0;
}

.server-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
}

.server-card-bg {
  height: 100px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.server-card-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
  opacity: 0.8;
}

.server-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

.guild-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 4px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.guild-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-header);
  text-align: center;
  margin-bottom: 0.25rem;
}

.guild-role {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.server-card-action {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

/* Dashboard Sidebar Layout */
.dashboard-layout {
  display: flex;
  flex: 1;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.sidebar-header .guild-icon-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.sidebar-header h3 {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  border-radius: var(--radius-button);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-header);
}

.nav-item.active {
  background: rgba(88, 101, 242, 0.15);
  color: var(--accent);
}

.main-content {
  flex: 1;
  background: var(--bg-main);
}

.main-content-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 3rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-button);
  color: var(--text-header);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255,255,255,0.02);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23949BA4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

select.form-control option {
  background-color: #1E1F22;
  color: #FFFFFF;
}

/* Plugin / Command List items */
.command-item {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
}

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.command-icon {
  width: 48px;
  height: 48px;
  background: rgba(88, 101, 242, 0.1);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.command-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.command-info h3::before {
  content: "/";
  color: var(--accent);
  font-weight: bold;
}

.command-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
}

.alert {
  padding: 1rem;
  border-radius: var(--radius-button);
  margin-bottom: 1.5rem;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid var(--accent);
  color: var(--text-header);
}

.alert-danger {
  background: rgba(218, 55, 60, 0.1);
  border-color: var(--danger);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Discord Preview Component */
.discord-preview-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: sticky;
  top: 2rem;
  border: 1px solid var(--border-color);
}

.discord-preview-header {
  background: rgba(0,0,0,0.1);
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.discord-preview {
    background-color: #313338;
    padding: 1.5rem;
    font-family: 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #dbdee1;
}

.discord-message {
    display: flex;
    gap: 1rem;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.discord-message-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.discord-header {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.discord-author {
    color: #f2f3f5;
    font-size: 1rem;
    font-weight: 500;
}

.discord-bot-tag {
    background-color: #5865F2;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 0.2rem;
    display: inline-flex;
    align-items: center;
}

.discord-timestamp {
    color: #949ba4;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.discord-text {
    font-size: 1rem;
    line-height: 1.375rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.discord-embed {
    background-color: #2b2d31;
    border-left: 4px solid #202225;
    border-radius: 4px;
    padding: 0.8rem 1rem;
    margin-top: 0.3rem;
    max-width: 432px;
}

.discord-embed-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.discord-embed-description {
    font-size: 0.875rem;
    line-height: 1.125rem;
    color: #dbdee1;
    white-space: pre-wrap;
}

.discord-embed-image {
    margin-top: 1rem;
    max-width: 100%;
    border-radius: 4px;
    display: none;
}
.discord-embed-footer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #dbdee1;
    display: flex;
    align-items: center;
}
.discord-components {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.discord-button {
    background-color: #4e5058;
    color: #dbdee1;
    padding: 2px 16px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    line-height: 28px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}
.discord-button:hover {
    background-color: #6d6f78;
}

/* Checkbox Toggle Style */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  transition: .2s;
  border-radius: 34px;
  border: 1px solid var(--border-color);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: .2s;
  border-radius: 50%;
}
input:checked + .toggle-slider {
  background-color: var(--success);
  border-color: var(--success);
}
input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: white;
  background-color: white;
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(88, 101, 242, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0); }
}

.float { animation: float 3s ease-in-out infinite; }
.pulse { animation: pulse 2s infinite; }

/* Home Page Utilities */
.feature-card {
  text-align: center;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-8px);
  border-color: var(--accent);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: rgba(88, 101, 242, 0.1);
  color: var(--accent);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
}

.footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    flex-direction: row;
    overflow-x: auto;
    height: auto;
    align-items: center;
  }
  .sidebar-header {
    margin-bottom: 0;
    padding: 0 1rem 0 0;
    border-bottom: none;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
  }
  .nav-label {
    display: none;
  }
  .nav-item {
    padding: 0.5rem 1rem;
    white-space: nowrap;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .main-content-inner {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2.5rem; }
  .grid { grid-template-columns: 1fr; }
}
