:root {
  --primary: #7047EB;
  --primary-light: #9173FF;
  --primary-dark: #4B22DC;
  --text-primary: #1F1F1F;
  --text-secondary: #5E5E5E;
  --text-light: #FFFFFF;
  --background: #FAFBFF;
  --card-bg: #FFFFFF;
  --border: #E8EBF0;
  --success: #38CB89;
  --warning: #FFBB38;
  --danger: #FF5A5A;
  --admin-accent: #FF6B6B;
  --modal-bg: rgba(17, 17, 17, 0.75);
  --shadow-sm: 0 1px 3px rgba(112, 71, 235, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(112, 71, 235, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(112, 71, 235, 0.12), 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px rgba(112, 71, 235, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #9173FF;
    --primary-light: #B79EFF;
    --primary-dark: #6E47EB;
    --text-primary: #F5F5F5;
    --text-secondary: #B4B4B4;
    --text-light: #FFFFFF;
    --background: #0F0F11;
    --card-bg: #1A1A1D;
    --border: #2A2A2E;
    --admin-accent: #FF8E8E;
    --modal-bg: rgba(0, 0, 0, 0.85);
    --shadow-sm: 0 1px 3px rgba(145, 115, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(145, 115, 255, 0.18), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(145, 115, 255, 0.2), 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(145, 115, 255, 0.25), 0 10px 10px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(26, 26, 29, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
  }
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, #F5F7FA 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, var(--background) 0%, #0A0A0C 100%);
  }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 1.5rem 0;
  border-bottom: 2px solid var(--admin-accent);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--admin-accent), transparent);
  opacity: 0.6;
}

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

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.site-logo svg {
  height: 40px;
  width: auto;
  color: var(--primary);
  transition: var(--transition);
  filter: drop-shadow(0 2px 4px rgba(112, 71, 235, 0.2));
}

.site-logo svg:hover {
  transform: scale(1.08) translateY(-2px);
  filter: drop-shadow(0 4px 12px rgba(145, 115, 255, 0.6));
  color: var(--primary-light);
}

.admin-badge {
  position: absolute;
  top: -0.5rem;
  right: -1rem;
  background: linear-gradient(135deg, var(--admin-accent), #FF8E8E);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 2px 12px rgba(255, 142, 142, 0.6);
  }
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Admin Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.admin-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--admin-accent), var(--primary-light), var(--admin-accent));
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.admin-header:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.admin-title h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-title p {
  color: var(--text-secondary);
}

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

.admin-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-accent), #FF8E8E);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3);
}

.admin-username {
  font-weight: 600;
  font-size: 1.1rem;
}

.admin-role {
  color: var(--admin-accent);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Sections */
.admin-section, .stats-section {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.admin-section::before, .stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: var(--transition);
}

.admin-section:hover::before, .stats-section:hover::before {
  opacity: 1;
}

.admin-section:hover, .stats-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.admin-section h2, .stats-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.admin-note {
  background: rgba(112, 71, 235, 0.1);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.admin-note p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

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

.stat-card:hover::before {
  left: 100%;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  background: var(--card-bg);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

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

.form-group input,
.form-select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(5px);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  font-weight: 500;
}

.form-group input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(145, 115, 255, 0.15), var(--shadow-sm);
  background: var(--card-bg);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
  transition: var(--transition);
}

.form-group input:focus::placeholder {
  opacity: 0.4;
  transform: translateX(4px);
}

.form-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.user-management,
.database-actions {
  margin-top: 1.5rem;
}

.action-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.action-card h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.action-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.search-results {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 400px;
  overflow-y: auto;
}

.search-results pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(112, 71, 235, 0.25);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

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

.button:hover::before {
  left: 100%;
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(112, 71, 235, 0.4);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.button.secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
}

.button.secondary:hover {
  background: rgba(112, 71, 235, 0.1);
  border-color: var(--primary-light);
  color: var(--primary);
}

.button.danger {
  background: linear-gradient(135deg, var(--danger), #FF7878);
}

.button.danger:hover {
  box-shadow: 0 5px 15px rgba(255, 90, 90, 0.3);
}

/* Danger Zone */
.danger-zone {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--danger);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.danger-zone h3 {
  color: var(--danger);
  margin-bottom: 0.5rem;
}

.danger-zone p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.danger-buttons {
  display: flex;
  gap: 1rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-bg);
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  max-width: 550px;
  margin: 2.5rem auto;
  padding: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalOpen 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border: 1px solid var(--glass-border);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  padding-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.modal-content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 100%;
  border-radius: 2px;
  animation: gradient-shift 3s ease infinite;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.results-content {
  max-height: 400px;
  overflow-y: auto;
  margin: 1rem 0;
}

.results-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--background);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

@keyframes modalOpen {
  from { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Manhwa Management Styles */
.manhwa-results {
    margin-top: 1.5rem;
}

.manhwa-list-header {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.manhwa-card {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.manhwa-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: var(--transition);
}

.manhwa-card:hover::before {
    opacity: 1;
}

.manhwa-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    background: var(--card-bg);
}

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

.manhwa-card-header h4 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.verified {
    background: rgba(56, 203, 137, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge.not-verified {
    background: rgba(255, 187, 56, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.manhwa-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: start;
}

.manhwa-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.manhwa-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.manhwa-info code {
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary);
}

.manhwa-cover-preview {
    max-width: 100px;
    max-height: 150px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.manhwa-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.manhwa-actions .button {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.button.success {
    background: linear-gradient(135deg, var(--success), #4DD9A3);
}

.button.success:hover {
    box-shadow: 0 5px 15px rgba(56, 203, 137, 0.3);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-actions .button {
    width: 100%;
  }

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

  .form-buttons,
  .danger-buttons {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .modal-content {
    margin: 1.5rem;
    width: calc(100% - 3rem);
  }
  
  .manhwa-card-body {
    grid-template-columns: 1fr;
  }
  
  .manhwa-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: auto;
  }
  
  .manhwa-actions .button {
    flex: 1;
    min-width: 120px;
  }
}

/* Dropdown pour sélection de manhwa */
.dropdown-container {
  position: relative;
}

.dropdown-input {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  margin-top: -2px;
}

.dropdown-item {
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(112, 71, 235, 0.1);
  color: var(--primary);
}

.dropdown-item.selected {
  background: rgba(112, 71, 235, 0.15);
  font-weight: 600;
}

.dropdown-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dropdown-item-url {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: monospace;
}

.dropdown-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* User result card */
.user-result-card {
  background: var(--glass-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.user-result-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.user-result-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.user-result-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.user-result-info p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.user-result-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.user-result-badge.role-user {
  background: rgba(112, 71, 235, 0.1);
  color: var(--primary);
}

.user-result-badge.role-premium {
  background: rgba(255, 187, 56, 0.1);
  color: var(--warning);
}

.user-result-badge.role-admin {
  background: rgba(255, 90, 90, 0.1);
  color: var(--danger);
}

