/*
==================================================
File: public/CSS/components.css
Reusable UI components – OTS
==================================================
*/

/* =================================================
   PANELS / CARDS
   ================================================= */

.panel {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

/* =================================================
   CARD (UI)
   ================================================= */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
}

/* =================================================
   SEPARATOR
   ================================================= */

.separator {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-color),
    transparent
  );
  margin: 18px 0;
}

/* =================================================
   ACTIONS
   ================================================= */

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.actions a,
.actions button {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.actions a:hover,
.actions button:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* =================================================
   TABLES (GÉNÉRIQUES)
   ================================================= */

.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead {
  background: var(--bg-card-alt);
}

.table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 14px 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

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

/* =================================================
   TABLE ACTION
   ================================================= */

.table-action {
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.table-action:hover {
  background: var(--primary);
  color: #ffffff;
}

/* =================================================
   EMPTY STATE
   ================================================= */

.empty-state {
  padding: 48px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* =================================================
   ROLES / AVATARS HALO
   ================================================= */

/* Halo animations */
@keyframes haloPulseSoft {
  0%   { box-shadow: 0 0 12px rgba(var(--halo), 0.4); }
  50%  { box-shadow: 0 0 28px rgba(var(--halo), 0.9); }
  100% { box-shadow: 0 0 12px rgba(var(--halo), 0.4); }
}

@keyframes haloPulseStrong {
  0%   { box-shadow: 0 0 18px rgba(var(--halo), 0.5); }
  50%  { box-shadow: 0 0 45px rgba(var(--halo), 1); }
  100% { box-shadow: 0 0 18px rgba(var(--halo), 0.5); }
}

/* SuperAdmin */
.avatar.role-superadmin {
  --halo: 255, 0, 204;
  background: linear-gradient(135deg, #ff00cc, #ff66e6);
  animation: haloPulseStrong 2.8s ease-in-out infinite;
}

.profile-role.role-superadmin {
  color: #ff00cc;
}

/* Admin */
.avatar.role-admin {
  --halo: 255, 26, 26;
  background: linear-gradient(135deg, #ff1a1a, #ff4d4d);
  animation: haloPulseSoft 2.2s ease-in-out infinite;
}

.profile-role.role-admin {
  color: #ff1a1a;
}

/* Moderator */
.avatar.role-moderator {
  --halo: 34, 197, 94;
  background: linear-gradient(135deg, #22c55e, #4ade80);
  animation: haloPulseSoft 3.2s ease-in-out infinite;
}

.profile-role.role-moderator {
  color: #22c55e;
}

/* Player */
.avatar.role-player {
  --halo: 30, 144, 255;
  background: linear-gradient(135deg, #1e90ff, #3fa9f5);
  animation: haloPulseSoft 4s ease-in-out infinite;
}

.profile-role.role-player {
  color: #1e90ff;
}

/* Texte glow */
@keyframes roleGlowPremium {
  0%   { text-shadow: 0 0 0 transparent; opacity: 0.85; }
  50%  { text-shadow: 0 0 10px currentColor; opacity: 1; }
  100% { text-shadow: 0 0 0 transparent; opacity: 0.85; }
}

.profile-role {
  animation: roleGlowPremium 3.8s ease-in-out infinite;
}

/* =================================================
   PROFILE / INFO LIST
   ================================================= */

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

.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list span {
  color: var(--text-muted);
}

/* =================================================
   PROFILE CARD (SPECIALIZED PANEL)
   ================================================= */

.profile-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.profile-card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-main);
}

/* =================================================
   PROFILE ACTIONS
   ================================================= */

.profile-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* =================================================
   SIDEBAR THEME SWITCH
   ================================================= */

.sidebar-theme {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}

.sidebar-theme button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: color 0.15s ease, border-color 0.15s ease;
}

.sidebar-theme button:hover,
.sidebar-theme button.active {
  color: var(--primary);
  border-color: var(--primary);
}

/* =================================================
   AUTH / LOGIN COMPONENTS
   ================================================= */

/* Card auth */
.auth-card {
  max-width: 420px;
  margin: auto;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
  border: 1px solid var(--border-color);
}

/* Icon */
.auth-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

/* Error message */
.auth-error {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

/* Input with icon */
.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-group i {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px 12px 40px;
}

.input-group input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Options (checkbox / links) */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.auth-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.auth-options input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.auth-options a {
  color: var(--primary);
}

.auth-options a:hover {
  text-decoration: underline;
}

/* Button full width */
.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
}
