/* ═════════════════════════════════════════════════════════════════ */
/* ROLES & DEPARTMENTS MANAGEMENT — CSS MODULE                      */
/* ═════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   HEADER ACTIONS - Buttons Group
   ───────────────────────────────────────────────────────────────── */

.users-header {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(25, 30, 48, 0.6));
  border: 1px solid rgba(100, 200, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.6s ease-out;
}

.users-header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.users-header .header-title {
  flex: 1;
}

.users-header .header-title h1 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.users-header .header-subtitle {
  font-size: 13px;
  color: var(--txtM);
  margin: 0;
  font-weight: 400;
}

.users-header .header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.users-header .header-actions .btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInUp 0.5s ease-out;
}

.users-header .header-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.users-header .header-actions .btn span {
  margin-right: 6px;
  font-size: 16px;
}

/* ─────────────────────────────────────────────────────────────────
   ROLE CARDS - Display Roles
   ───────────────────────────────────────────────────────────────── */

.role-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card::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;
}

.role-card:hover::before {
  left: 100%;
}

.role-card:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.role-card .role-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
  animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.role-card .role-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 8px 0;
  text-transform: capitalize;
}

.role-card .role-desc {
  font-size: 12px;
  color: var(--txtL);
  margin: 6px 0 0 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-card .role-count {
  font-size: 11px;
  color: var(--solar);
  font-weight: 600;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─────────────────────────────────────────────────────────────────
   DEPARTMENT CARDS - Display Departments
   ───────────────────────────────────────────────────────────────── */

.department-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.department-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -100%;
  width: calc(100% + 4px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.8), transparent);
  transition: left 0.5s ease;
}

.department-card:hover::before {
  left: 100%;
}

.department-card:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.1));
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(168, 85, 247, 0.15);
}

.department-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.department-card-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 10px;
}

.department-card-title {
  flex: 1;
}

.department-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.department-card-manager {
  font-size: 12px;
  color: var(--txtL);
  margin: 4px 0 0 0;
}

.department-card-actions {
  display: flex;
  gap: 8px;
}

.department-card-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--txtL);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.department-card-action-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #fff;
}

.department-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dept-info-item {
  display: flex;
  flex-direction: column;
}

.dept-info-label {
  font-size: 11px;
  color: var(--txtL);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.dept-info-value {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────────
   LISTS - Compact Displays
   ───────────────────────────────────────────────────────────────── */

.roles-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.departments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* ─────────────────────────────────────────────────────────────────
   AOS ANIMATIONS - Enhanced Entrance Effects
   ───────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  [data-aos] {
    opacity: 0;
  }

  [data-aos].aos-animate {
    opacity: 1;
  }
}

/* Fade animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.8, 0.8, 0.8);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
  }
}

/* Apply to cards */
.role-card[data-aos] {
  animation-duration: 0.6s;
}

.department-card[data-aos] {
  animation-duration: 0.7s;
}

/* ─────────────────────────────────────────────────────────────────
   MODALS - Role and Department Creation
   ───────────────────────────────────────────────────────────────── */

#modalRole .modal,
#modalDepartment .modal {
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#modalRole .form-input,
#modalRole .form-select,
#modalRole .form-textarea,
#modalDepartment .form-input,
#modalDepartment .form-select,
#modalDepartment .form-textarea {
  transition: all 0.3s ease;
}

#modalRole .form-input:focus,
#modalRole .form-select:focus,
#modalRole .form-textarea:focus,
#modalDepartment .form-input:focus,
#modalDepartment .form-select:focus,
#modalDepartment .form-textarea:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE - Mobile Optimization
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .users-header .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .users-header .header-actions {
    width: 100%;
  }

  .users-header .header-actions .btn {
    flex: 1;
    min-width: 120px;
  }

  .roles-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .departments-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .users-header {
    padding: 16px;
  }

  .users-header .header-title h1 {
    font-size: 20px;
  }

  .users-header .header-actions {
    gap: 8px;
  }

  .users-header .header-actions .btn {
    font-size: 12px;
    padding: 10px 12px;
  }

  .users-header .header-actions .btn span {
    font-size: 14px;
  }

  .roles-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .departments-grid {
    grid-template-columns: 1fr;
  }

  .department-card-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .users-header .header-title h1 {
    font-size: 18px;
  }

  .users-header .header-actions {
    flex-direction: column;
  }

  .users-header .header-actions .btn {
    width: 100%;
  }

  .role-card {
    padding: 16px;
  }

  .role-card .role-icon {
    font-size: 24px;
  }

  .role-card .role-name {
    font-size: 13px;
  }
}

/* ═════════════════════════════════════════════════════════════════ */
