* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --secondary: #f093fb;
  --success: #51cf66;
  --danger: #ff6b6b;
  --warning: #ffa94d;
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #333333;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --bg: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --border: #444444;
  --shadow: rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.3s ease;
}

body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 5px 20px var(--shadow);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px var(--shadow);
}

/* Login Page */
.login-container {
  width: 100%;
  max-width: 500px;
  padding: 20px;
  animation: slideUp 0.6s ease;
}

.login-card {
  background: var(--bg);
  border-radius: 20px;
  box-shadow: 0 20px 60px var(--shadow);
  padding: 50px 40px;
  text-align: center;
  border: 1px solid var(--border);
}

.login-card h1 {
  font-size: 42px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.login-card p {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 15px;
  line-height: 1.6;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn {
  padding: 14px 24px;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  min-height: 50px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-google {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--primary);
}

.btn-google:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-guest {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: 2px solid transparent;
}

.btn-guest:hover {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.divider {
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  display: inline-block;
  width: 40%;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
}

.divider::before {
  margin-right: 10px;
}

.divider::after {
  margin-left: 10px;
}

/* Dashboard Page */
.dashboard-container {
  width: 100%;
  max-width: 1720px;
  padding: 30px 28px 40px;
  animation: slideUp 0.6s ease;
}

.dashboard-header {
  background: var(--bg);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 250px;
}

.user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  overflow: hidden;
  border: 3px solid var(--border);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details h2 {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 5px;
  font-weight: 700;
}

.user-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auth-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--primary);
  color: white;
}

.auth-badge.guest {
  background: var(--warning);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logout-btn, .admin-btn {
  background: var(--danger);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 14px;
}

.admin-btn {
  background: var(--primary);
}

.logout-btn:hover {
  background: #ff5252;
  transform: translateY(-2px);
}

.admin-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Search Bar */
.search-section {
  background: var(--bg);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px var(--shadow);
  border: 1px solid var(--border);
}

.search-header {
  margin-bottom: 14px;
}

.search-header h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 4px;
}

.search-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.overview-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
}

.overview-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper input {
  width: 100%;
  padding: 14px 20px 14px 45px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: var(--bg-secondary);
  color: var(--text);
  transition: all 0.3s ease;
}

.search-input-wrapper input::placeholder {
  color: var(--text-secondary);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-secondary);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.category-chip {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.category-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
}

.category-chip.active {
  background: var(--bg);
  color: var(--primary-dark);
  border-color: var(--bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.project-category-block {
  margin-bottom: 26px;
}

.project-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 2px;
}

.project-category-header h3 {
  font-size: 20px;
  color: #ffffff;
  font-weight: 800;
}

.category-count {
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.project-card {
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 20px var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  position: relative;
  group: project-card;
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px var(--shadow);
  border-color: var(--primary);
}

.project-icon {
  font-size: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  text-align: center;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.project-card:hover .project-icon {
  transform: scale(1.1);
}

.project-card[data-id="mgu"] .project-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.project-card[data-id="passie"] .project-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.project-card[data-id="dnd"] .project-icon {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.project-card[data-id="scouting"] .project-icon {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.project-card[data-id="discord-bot"] .project-icon {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.project-card[data-id="discord-bot-art"] .project-icon {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.project-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}

.project-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
  line-height: 1.5;
}

.project-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
}

.project-link:hover {
  color: var(--primary-dark);
  gap: 5px;
}

.project-link::after {
  content: ' →';
  transition: transform 0.3s ease;
}

.project-card:hover .project-link::after {
  transform: translateX(5px);
}

/* Badge for auth requirement */
.auth-required-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
  margin-top: auto;
  width: fit-content;
}

.auth-required-badge.public {
  background: rgba(81, 207, 102, 0.18);
  color: #2f9e44;
}

/* No Projects */
.no-projects {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg);
  border-radius: 16px;
  border: 2px dashed var(--border);
}

.no-projects-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.no-projects h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--text);
}

.no-projects p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Admin Dashboard */
.admin-dashboard {
  max-width: 1200px;
  width: 100%;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 15px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-tab:hover {
  color: var(--text);
}

.admin-content {
  background: var(--bg);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 5px 20px var(--shadow);
  border: 1px solid var(--border);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  text-align: left;
  padding: 15px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.users-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}

.users-table tr:hover {
  background: var(--bg-secondary);
}

.user-email-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.user-email-link:hover {
  text-decoration: underline;
}

.delete-user-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.delete-user-btn:hover {
  background: #ff5252;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 25px;
  color: white;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.stat-card h4 {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 20px;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid white;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: white;
  font-size: 16px;
  font-weight: 500;
}

/* Error Message */
.error-message {
  background: var(--danger);
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  animation: slideDown 0.3s ease;
}

.error-message::before {
  content: '⚠️';
  font-size: 18px;
}

.success-message {
  background: var(--success);
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  animation: slideDown 0.3s ease;
}

.success-message::before {
  content: '✓';
  font-size: 18px;
  font-weight: bold;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 24px 14px 28px;
  }

  .dashboard-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .overview-value {
    font-size: 24px;
  }

  .login-card {
    padding: 40px 25px;
  }

  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-filters {
    gap: 8px;
    margin-bottom: 18px;
  }

  .category-chip {
    font-size: 11px;
    padding: 7px 12px;
  }

  .project-category-header h3 {
    font-size: 18px;
  }

  .user-info {
    flex-direction: column;
    justify-content: center;
    width: 100%;
  }

  .admin-tabs {
    overflow-x: auto;
  }

  .users-table {
    font-size: 12px;
  }

  .users-table th,
  .users-table td {
    padding: 10px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 20px;
  }

  .login-card h1 {
    font-size: 32px;
  }

  .btn {
    font-size: 15px;
    padding: 12px 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
