/**
 * Custom Styles for Auth Server SuperAdmin UI
 * Supplements Tailwind CSS with custom animations and utilities
 */

/* === Global Styling === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Background Image === */
.bg-app-pattern {
  background-image: url("assets/images/background.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  position: relative;
}

/* === Background Overlay === */
.bg-app-pattern::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85); /* slate-900 with 85% opacity */
  pointer-events: none;
  z-index: 0;
}

.bg-app-pattern > * {
  position: relative;
  z-index: 1;
}

/* === Footer Badge Animation === */
.footer-badge {
  transition: all 0.3s ease;
}

.footer-badge:hover {
  transform: scale(1.1) rotate(5deg);
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1e293b; /* slate-800 */
}

::-webkit-scrollbar-thumb {
  background: #475569; /* slate-600 */
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b; /* slate-500 */
}

/* === Loading Spinner === */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

/* === Fade In Animation === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* === Modal Animations === */
.modal-backdrop {
  transition: opacity 0.3s ease-out;
}

/* === Role Card Hover Effects === */
.role-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-card:active {
  transform: scale(0.98);
}

/* === Card Hover Effect === */
.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* === Badge Styles === */
.badge-success {
  background-color: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* === Code/JSON Display === */
.code-block {
  background-color: #0f172a; /* slate-950 */
  border: 1px solid #334155; /* slate-700 */
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.875rem;
  color: #94a3b8; /* slate-400 */
  overflow-x: auto;
  max-height: 400px;
}

/* === Responsive Table === */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive table {
    min-width: 600px;
  }
}

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

.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* === Focus Visible (Accessibility) === */
*:focus-visible {
  outline: 2px solid #0ea5e9; /* primary-500 */
  outline-offset: 2px;
}

/* === Disabled State === */
[disabled],
.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* === Remove Number Input Spinners === */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* === Print Styles === */
@media print {
  body {
    background: white;
  }

  nav,
  footer,
  button {
    display: none;
  }
}
