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

:root {
  --bg-primary: #09070f;
  --bg-secondary: #130f24;
  --bg-glass: rgba(25, 18, 48, 0.65);
  --border-glass: rgba(168, 85, 247, 0.15);
  --border-glass-focus: rgba(6, 182, 212, 0.4);
  
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  
  --text-primary: #f3f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #6b7280;
  
  --font-outfit: 'Outfit', sans-serif;
  --font-inter: 'Inter', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Reset & Scrollbar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #272147;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

body {
  font-family: var(--font-inter);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-outfit);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header & Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(9, 7, 15, 0.75);
  border-bottom: 1px solid var(--border-glass);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-container [data-bot-nav] {
  flex: 1;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-outfit);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.logo-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: white;
  font-size: 1.2rem;
  -webkit-text-fill-color: white;
  box-shadow: var(--glow-shadow);
}

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

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-glass);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  border: 1px solid var(--border-glass);
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
}

.username {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-outfit);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #9333ea);
  color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

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

.btn-secondary:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), #0891b2);
  color: white;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-logout {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-logout:hover {
  color: var(--accent-red);
}

/* Landing Page (Hero) */
.hero {
  max-width: 1000px;
  margin: 8rem auto 4rem auto;
  text-align: center;
  padding: 0 2rem;
}

.badge {
  display: inline-block;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--accent-purple);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #d8b4fe, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Features Grid */
.features {
  max-width: 1100px;
  margin: 6rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 2.5rem 2rem;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Guild Selector / Dashboard */
.main-content {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.guild-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition-smooth);
}

.guild-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-purple);
  box-shadow: var(--glow-shadow);
}

.guild-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: #272147;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-purple);
  margin-bottom: 1.25rem;
  border: 2px solid var(--border-glass);
}

.guild-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.guild-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.guild-actions {
  width: 100%;
  margin-top: auto;
}

.guild-actions .btn {
  width: 100%;
}

/* Settings Container & Tabs */
.settings-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2.5rem;
  backdrop-filter: blur(15px);
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--border-glass);
  padding-right: 1.5rem;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.category-tab:hover {
  background: rgba(168, 85, 247, 0.08);
  color: var(--text-primary);
}

.category-tab.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(6, 182, 212, 0.1));
  border: 1px solid var(--border-glass);
  color: var(--accent-cyan);
}

/* Settings Panel content */
.settings-panel {
  display: none;
}

.settings-panel.active {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.4s ease-out;
}

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

.panel-header {
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.8rem;
  color: var(--text-primary);
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Log Config Row */
.log-row {
  background: rgba(9, 7, 15, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  transition: var(--transition-smooth);
}

.log-row:hover {
  border-color: rgba(168, 85, 247, 0.2);
  background: rgba(9, 7, 15, 0.6);
}

.log-info {
  flex: 1;
  min-width: 250px;
}

.log-title {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.log-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.log-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Custom Select styling */
.channel-select {
  background-color: #120e23;
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 0.6rem 2rem 0.6rem 1rem;
  border-radius: 8px;
  font-family: var(--font-inter);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' 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 0.75rem center;
  background-size: 1rem;
  min-width: 200px;
  transition: var(--transition-smooth);
}

.channel-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.channel-select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Custom Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #272147;
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Footer / Action bar inside settings */
.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(19, 15, 36, 0.95);
  border-left: 4px solid var(--accent-purple);
  border-top: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.toast.success {
  border-left-color: var(--accent-green);
}

.toast.error {
  border-left-color: var(--accent-red);
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Overrides */
@media(max-width: 900px) {
  .settings-container {
    grid-template-columns: 1fr;
  }
  .settings-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    padding-right: 0;
    padding-bottom: 1.5rem;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
  }
  .category-tab {
    display: inline-flex;
  }
}

@media(max-width: 600px) {
  .hero h1 {
    font-size: 3rem;
  }
  .nav-container {
    padding: 1rem;
  }
  .log-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .log-controls {
    width: 100%;
    justify-content: space-between;
  }
  .channel-select {
    flex: 1;
  }
}
