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

:root {
  --bg-dark: #0a0a0c;
  --bg-card: #121217;
  --bg-hover: #1c1c24;
  --bg-input: #08080a;
  --accent-primary: #ff4d4d;
  --accent-secondary: #ff7675;
  --text-main: #ffffff;
  --text-dim: #94949e;
  --sidebar-width: 280px;
  --success: #2ecc71;
  --border: rgba(255, 255, 255, 0.06);
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-main: 0 10px 30px rgba(0,0,0,0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 4.5rem;
  padding-left: 0.5rem;
}

.logo-icon img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(255, 77, 77, 0.3);
}

.logo-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.8rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.4rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-link:hover, .nav-link.active {
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.15), rgba(255, 77, 77, 0.05));
  color: var(--text-main);
  transform: translateX(8px);
}

.nav-link i {
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 3rem;
  width: calc(100% - var(--sidebar-width));
}

header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4rem;
}

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

.toast {
  background: var(--bg-card);
  color: white;
  padding: 1rem 2rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--accent-primary); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-primary);
  width: 100%;
  animation: progress 3s linear forwards;
}

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

@keyframes progress {
  from { width: 100%; }
  to { width: 0%; }
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--bg-card);
  padding: 0.7rem 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  cursor: default;
}

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

/* Guild Header */
.guild-header {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 4rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.guild-icon {
  width: 120px;
  height: 120px;
  border-radius: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.guild-info h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -1.5px;
}

.guild-info p {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 1.1rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.stat-card span {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 1rem;
}

.stat-card h3 {
  font-size: 2rem;
  font-weight: 800;
}

/* Rule Cards */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.rule-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border);
  transition: all 0.4s ease;
  position: relative;
}

.rule-card.active {
  border-color: rgba(255, 77, 77, 0.4);
  box-shadow: 0 15px 40px rgba(255, 77, 77, 0.05);
}

.rule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.rule-card-info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.rule-card-info p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

.rule-settings {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.setting-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: 14px;
  color: white;
  outline: none;
  font-size: 0.95rem;
  transition: all 0.3s;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.1);
}

/* Custom Toggles */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--bg-input);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.toggle-row span {
  font-size: 0.9rem;
  font-weight: 600;
}

.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: #2a2a32;
  transition: .4s;
  border-radius: 34px;
}

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

input:checked + .slider {
  background-color: var(--accent-primary);
}

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

/* Multi-Select */
.multi-select-container {
  position: relative;
}

.multi-select-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  cursor: pointer;
  align-items: center;
}

.selected-tag {
  background: rgba(255, 77, 77, 0.15);
  color: var(--accent-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid rgba(255, 77, 77, 0.1);
}

.multi-select-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-height: 320px;
  overflow: hidden;
  z-index: 1000;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.multi-select-dropdown.open {
  display: flex;
  flex-direction: column;
}

.dropdown-search {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
}

.dropdown-search i {
  position: absolute;
  right: 2.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.dropdown-search input {
  padding: 0.8rem 2.5rem 0.8rem 1rem;
  font-size: 0.85rem;
}

.dropdown-options {
  overflow-y: auto;
  max-height: 240px;
  padding: 0.5rem;
}

.dropdown-option {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-size: 0.95rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.dropdown-option:hover {
  background: var(--bg-hover);
}

.dropdown-option.selected {
  background: rgba(255, 77, 77, 0.08);
  color: var(--accent-primary);
}

.dropdown-option i {
  opacity: 0;
  transition: opacity 0.2s;
}

.dropdown-option.selected i {
  opacity: 1;
}

/* Save Bar */
.save-bar {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  background: var(--bg-card);
  padding: 1.5rem 3rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 50px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 4rem;
  z-index: 2000;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
}

.save-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.save-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.reset-btn {
  background: transparent;
  color: white;
  border: 1px solid var(--border);
  padding: 1rem 2.5rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 1.2rem;
}

/* Violations Table */
.violations-card {
  margin-top: 2rem;
  background: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.table-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-wrapper {
  position: relative;
}

.search-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-wrapper input {
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  font-size: 0.9rem;
  width: 250px;
}

.filter-btn, .export-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.filter-btn:hover, .export-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

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

.logs-table th {
  text-align: left;
  padding: 1.2rem 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  background: rgba(255, 255, 255, 0.01);
}

.logs-table td {
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.logs-table tr:last-child td {
  border-bottom: none;
}

.logs-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

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

.status-badge {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-badge.warn { background: rgba(255, 179, 0, 0.1); color: #ffb300; }
.status-badge.mute { background: rgba(255, 77, 77, 0.1); color: var(--accent-primary); }
.status-badge.kick { background: rgba(255, 0, 0, 0.1); color: #ff0000; }
.status-badge.ban { background: rgba(128, 0, 0, 0.1); color: #ff4d4d; }
.status-badge.delete { background: rgba(255, 255, 255, 0.05); color: var(--text-dim); }

/* Filter Modal */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.filter-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.filter-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 450px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.filter-modal.visible .filter-content {
  transform: scale(1);
}

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

.filter-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

.filter-group select {
  padding: 0.8rem 1rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

.filter-group select option {
  background: var(--bg-card);
  color: white;
}

.filter-footer {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.2rem;
}

/* User Hover Logic */
.hover-id {
  cursor: pointer;
  position: relative;
}

.display-name {
  transition: opacity 0.2s;
}

.user-id-hover {
  position: absolute;
  left: 0;
  opacity: 0;
  font-family: monospace;
  color: var(--accent-primary);
  transition: opacity 0.2s;
  font-weight: 700;
}

.hover-id:hover .display-name {
  opacity: 0;
}

.hover-id:hover .user-id-hover {
  opacity: 1;
}
.pagination {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
}

.page-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: var(--text-dim);
}

.page-num.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

.page-num:hover:not(.active) {
  background: var(--bg-hover);
  color: white;
}

.page-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.page-btn:hover:not(:disabled) {
  color: white;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Checkboxes */
.checkbox-cell {
  width: 50px;
  text-align: center;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Export Modal */
.export-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.export-option-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 1.2rem 1rem;
  border-radius: 16px;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.export-option-btn i {
  font-size: 1.5rem;
  color: var(--text-dim);
}

.export-option-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.export-option-btn:hover i {
  color: var(--accent-primary);
}

.export-option-btn span {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.selection-info {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 77, 77, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 77, 77, 0.2);
  color: var(--accent-primary);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .rule-grid { grid-template-columns: 1fr; }
  .main-content { padding: 2rem; }
  .logs-table th:nth-child(3), 
  .logs-table td:nth-child(3) { display: none; }
}
