/* ============================================
   Sonance - Guild Dashboard Styles
   ============================================ */

:root {
  --primary: #5865f2;
  --primary-dark: #4752c4;
  --secondary: #57f287;
  --danger: #ed4245;
  --warning: #fee75c;
  --background: #0e1117;
  --surface: #1a1d29;
  --surface-light: #2a2d3a;
  --text: #ffffff;
  --text-muted: #b9bbbe;
  --border: #2a2d3a;
  --success: #57f287;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

/* ============================================
   Utility Classes
   ============================================ */

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.error-message {
  color: var(--danger);
  padding: 0.75rem;
  margin-top: 1rem;
  background: rgba(237, 66, 69, 0.1);
  border-radius: var(--radius);
  border: 1px solid var(--danger);
}

.info-text {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* ============================================
   Login Screen
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.logo p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: var(--text);
  width: 100%;
}

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

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-small:not(:last-child) {
  margin-right: 0.5rem;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  background: var(--surface);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow);
}

.nav-brand h2 {
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.nav-link {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.nav-link:hover {
  background: var(--surface-light);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary);
  color: var(--text);
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================
   Container & Layout
   ============================================ */

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

.view-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-header h1 {
  font-size: 2rem;
}

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

.view-actions {
  display: flex;
  gap: 1rem;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

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

.card-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.card-body {
  padding: 1.5rem;
}

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content h3 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.stat-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   Toggle Group
   ============================================ */

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.period-select {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.period-select:hover {
  border-color: var(--primary);
}

.period-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-input {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 150px;
}

.date-input:hover {
  border-color: var(--primary);
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.week-display {
  display: inline-block;
  background: var(--surface-light);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.period-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.toggle-group {
  display: flex;
  gap: 0.5rem;
  background: var(--background);
  padding: 0.25rem;
  border-radius: var(--radius);
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  color: var(--text);
}

.toggle-btn.active {
  background: var(--primary);
  color: var(--text);
}

/* ============================================
   Badge
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================
   Tables
   ============================================ */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--background);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table tbody tr {
  cursor: pointer;
  transition: all 0.2s;
}

.table tbody tr:hover {
  background: var(--surface-light);
  transform: translateX(4px);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--background);
  transition: all 0.2s;
}

.activity-dot.completed {
  background: var(--success);
}

/* ============================================
   Search
   ============================================ */

.search-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.user-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.user-item {
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.user-item:hover {
  background: var(--surface-light);
  border-color: var(--primary);
}

.user-item h4 {
  margin-bottom: 0.25rem;
}

.user-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   Activity Lists
   ============================================ */

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-list-item {
  padding: 0.75rem 1rem;
  background: var(--background);
  margin: 0.5rem 0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 3px solid transparent;
}

.activity-list-item.completed {
  border-left-color: var(--success);
}

.activity-list-item.incomplete {
  border-left-color: var(--border);
  opacity: 0.6;
}

.activity-icon {
  font-size: 1.25rem;
}

.activity-info {
  flex: 1;
}

.activity-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.activity-description {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.btn-secondary:hover {
  background: var(--surface-light);
  border-color: var(--primary);
}

/* ============================================
   Quick Stats
   ============================================ */

.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.quick-stat-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.quick-stat-item:hover {
  background: var(--surface-light);
  transform: translateX(4px);
}

.rank-badge {
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  min-width: 35px;
  text-align: center;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #000;
}

.rank-badge.silver {
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  color: #000;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #cd7f32, #e8a87c);
  color: #000;
}

.attention-icon {
  font-size: 1.25rem;
  min-width: 35px;
  text-align: center;
}

.quick-stat-item .activity-info {
  flex: 1;
  min-width: 0;
}

.quick-stat-item .activity-info strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-stat-item .percentage {
  font-weight: bold;
  font-size: 1rem;
  min-width: 45px;
  text-align: right;
}

.quick-stat-item .percentage.high {
  color: var(--success);
}

.quick-stat-item .percentage.medium {
  color: var(--warning);
}

.quick-stat-item .percentage.low {
  color: var(--danger);
}

.quick-stat-item .progress-bar-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.quick-stat-item .progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    width: 100%;
  }

  .nav-actions {
    width: 100%;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  .quick-stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.5rem;
  }
}
