@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-main: #e0e0e0;
  --text-muted: #a0a0a0;
  --primary: #bb86fc;
  --primary-hover: #9965f4;
  --secondary: #03dac6;
  --error: #cf6679;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  /* Removed display:flex; min-height:100vh; to allow normal flow for landing page */
  /* We will restore flex for the admin layout specifically or use a wrapper */
}

/* Make admin layout work by wrapping it or simpler: separate styles? */
/* Given existing files, let's keep body general and add specific layout classes */

/* --- ADMIN LAYOUT --- */
/* The existing admin.html has <div class="sidebar"> and <div class="main-content"> as direct children of body.
   To support both layouts without conflict, we should probably wrap the admin content in a wrapper,
   BUT since we are editing files, let's just make body flex ONLY if sidebar exists?
   No, CSS doesn't work like that.
   We can check if .sidebar exists using :has() but that's new.
   Better: Set body display block by default, and use a wrapper for admin.
   Wait, modifying admin.html to add a wrapper is safer.
   Or, since we only have one body, we can just style .sidebar and .main-content to position themselves.
*/

/* Reverting body flex for global use, using flexbox on a wrapper for admin if possible. 
   But since I renamed index.html to admin.html, I can wrap the content in admin.html later?
   Actually, let's just make the landing page work with flex column, or override body on landing page specific CSS?
   Easier: Just use classes.
*/

/* --- LANDING PAGE STYLES --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.btn-login {
  background-color: #5865F2;
  /* Discord Color */
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-login:hover {
  background-color: #4752C4;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 100px 10%;
  background: radial-gradient(circle at top right, #332042, transparent 40%);
}

.hero-content {
  max-width: 600px;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

.btn-primary-large {
  background: var(--primary);
  color: #121212;
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary-large:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(187, 134, 252, 0.3);
}

.btn-secondary-large {
  border: 2px solid var(--text-muted);
  color: var(--text-main);
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary-large:hover {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.features {
  padding: 80px 10%;
  background-color: #181818;
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 60px;
  font-size: 2.5rem;
  margin-bottom: 60px;
}

/* Mobile defaults */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  background: var(--card-bg);
  border: 1px solid #444;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-card i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-card h3 {
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.5;
}

footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  border-top: 1px solid #333;
}


/* --- RESTORED ADMIN STYLES --- */
/* Helper class for admin layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Apply flex to body only if it doesn't break landing? 
   Let's wrap admin content in .admin-layout in admin.html 
   and move .sidebar and .main-content rules to work within it.
*/

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  /* Toggled to flex by JS */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: #1e1e1e;
  /* Hardcode Dark Color */
  color: #ffffff;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  text-align: center;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--card-bg);
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  color: var(--primary);
  margin-bottom: 40px;
  text-align: center;
}

.sidebar a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  transition: background 0.2s, color 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  background-color: #333;
  color: var(--text-main);
}

.btn-secondary {
  background: #555;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #121212;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.btn-danger {
  background: var(--error);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.config-group {
  margin-bottom: 20px;
  text-align: left;
}

.config-group label {
  display: block;
  margin-bottom: 8px;
  color: #ccc;
  font-weight: 500;
}

.config-group input[type="number"],
.config-group input[type="text"] {
  background: #2a2a2a;
  color: white;
  border: 1px solid #444;
  padding: 12px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.config-group input:focus {
  border-color: var(--primary);
  outline: none;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  background: #2a2a2a;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #444;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-wrapper:hover {
  background: #333;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.header {
  margin-bottom: 30px;
}

.header h1 {
  font-size: 2rem;
  margin: 0;
  color: var(--text-main);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--secondary);
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.status-badge {
  padding: 5px 10px;
  border-radius: 15px;
  background-color: #2e7d32;
  color: white;
  font-size: 0.9em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #333;
}

th {
  color: var(--text-muted);
}

/* Buttons */
button {
  transition: transform 0.1s, opacity 0.2s, filter 0.2s;
}

button:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  filter: grayscale(1);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Server Selector */
.server-select-input {
  width: 100%;
  padding: 8px;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  margin-bottom: 10px;
  cursor: pointer;
}

.server-select-input:focus {
  outline: none;
  border-color: var(--primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.user-name {
  font-weight: 500;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 150px;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  z-index: 200;
}

.user-profile:hover .dropdown {
  display: flex;
}

.dropdown a {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.dropdown a:hover {
  background: #333;
}

.dropdown a.logout {
  color: var(--error);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

  /* Navbar */
  .navbar {
    padding: 15px 20px;
    flex-direction: row;
    /* Keep row */
    justify-content: space-between;
  }

  .nav-actions {
    display: flex;
    align-items: center;
  }

  /* Hero */
  .hero {
    flex-direction: column-reverse;
    /* Image on top? No, image usually bottom or hidden on mobile if huge */
    text-align: center;
    padding: 40px 20px;
    gap: 40px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-image i {
    font-size: 8rem !important;
    /* Smaller icon */
  }

  .hero-buttons {
    justify-content: center;
    flex-direction: column;
  }

  .btn-primary-large,
  .btn-secondary-large {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  /* Admin Layout Mobile - Off-Canvas */
  .admin-layout {
    display: block;
    /* Remove flex constraint on mobile to let main content sit normally */
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    width: 260px;
    z-index: 1002;
    /* Above overlay */
    transition: left 0.3s ease;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    /* Restore styles overridden by previous mobile query if any */
    white-space: normal;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar h2 {
    display: block;
    margin-top: 10px;
  }

  .sidebar a {
    margin-bottom: 8px;
    padding: 12px;
    font-size: 1rem;
    display: block;
    /* stack vertically */
  }

  .main-content {
    padding: 20px;
    padding-top: 75px;
    /* Space for toggle button */
    margin-left: 0;
  }

  /* Mobile Elements Visibility */
  .mobile-menu-toggle {
    display: block !important;
    /* Override default hidden */
  }

  .mobile-overlay {
    display: block;
    /* Allow JS to toggle visibility class */
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .cards {
    grid-template-columns: 1fr;
    /* Single column */
  }

  /* Table Responsive */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}