/* Discord Permissions Manager - Custom Styles */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #2b2d31;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #1e1f22;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #404249;
}

/* Animation for loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Button hover effects */
button:hover {
  filter: brightness(1.1);
}

button:active {
  transform: scale(0.98);
}

/* Input focus styles */
input:focus {
  outline: none;
  border-color: #5865f2 !important;
}

/* Select styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select:focus {
  outline: none;
}

/* Transition for all interactive elements */
button, a, input, select {
  transition: all 0.15s ease;
}

/* Toast/notification styles */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: #313338;
  color: #dbdee1;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

/* Permission badge animations */
.permission-badge {
  transition: all 0.2s ease;
}

.permission-badge:hover {
  transform: translateY(-1px);
}

/* Category header styling */
.category-header {
  user-select: none;
}

/* Smooth transitions for dialogs */
.dialog-overlay {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog-content {
  animation: slideUp 0.2s ease;
}

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

/* Avatar placeholder */
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5865f2, #7289da);
}

/* Role color indicator */
.role-indicator {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Grid responsive adjustments */
@media (max-width: 768px) {
  .permission-grid {
    grid-template-columns: 1fr !important;
  }
  
  .sidebar {
    width: 180px !important;
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    width: 100% !important;
  }
}

/* Boost level badge glow effect */
.boost-badge {
  position: relative;
}

.boost-badge::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #ff73fa, #7289da);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.boost-badge:hover::after {
  opacity: 0.5;
}

/* Permission toggle hover state */
.permission-toggle {
  position: relative;
  overflow: hidden;
}

.permission-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.permission-toggle:hover::before {
  left: 100%;
}

/* Error state styling */
.error-message {
  color: #ed4245;
  background: rgba(237, 66, 69, 0.1);
  border: 1px solid rgba(237, 66, 69, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
}

/* Success state styling */
.success-message {
  color: #3ba55d;
  background: rgba(59, 165, 93, 0.1);
  border: 1px solid rgba(59, 165, 93, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
}

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #5865f2;
  outline-offset: 2px;
}
