/* ================================================================
   Interactive Enhancements - Micro-interactions & Visual Feedback
   Additional hover effects, transitions, and animations for better UX
   ================================================================ */

/* ── 1. BUTTON ENHANCEMENTS ─────────────────────────────────────── */
.btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Ripple effect */
.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(0, 89, 187, 0.35);
}

.btn-outline:hover {
  box-shadow: 0 4px 15px rgba(0, 89, 187, 0.2);
}

/* ── 2. CARD ENHANCEMENTS ──────────────────────────────────────────── */
.admin-card,
.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-card:hover,
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.admin-card-header {
  transition: background 0.2s ease;
}

.admin-card:hover .admin-card-header {
  background: #f0f4f8;
}

/* ── 3. INPUT ENHANCEMENTS ─────────────────────────────────────────── */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  transition: all 0.2s ease;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(0, 89, 187, 0.15);
}

.form-control:hover {
  border-color: #93c5fd;
}

/* ── 4. TABLE ROW ENHANCEMENTS ─────────────────────────────────────── */
.admin-table tbody tr {
  transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
  background: #f0f9ff;
  transform: scale(1.005);
}

.admin-table tbody tr:hover td {
  color: #0059bb;
}

/* ── 5. LINK ENHANCEMENTS ─────────────────────────────────────────── */
a {
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: none;
}

a:not(.btn):hover {
  position: relative;
}

a:not(.btn):hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #0059bb;
  transition: width 0.3s ease;
}

a:not(.btn):hover::after {
  width: 100%;
}

/* ── 6. ICON BUTTON ENHANCEMENTS ─────────────────────────────────── */
.btn-ghost,
.btn-icon {
  transition: all 0.2s ease;
}

.btn-ghost:hover,
.btn-icon:hover {
  background: rgba(0, 89, 187, 0.1);
  transform: scale(1.1);
}

.btn-ghost:active,
.btn-icon:active {
  transform: scale(0.95);
}

/* ── 7. BADGE ENHANCEMENTS ─────────────────────────────────────────── */
.badge {
  transition: all 0.2s ease;
}

.badge:hover {
  transform: scale(1.1);
}

/* ── 8. TOGGLE SWITCH ENHANCEMENTS ─────────────────────────────────── */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  transition: all 0.2s ease;
}

.form-group input[type="checkbox"]:checked,
.form-group input[type="radio"]:checked {
  transform: scale(1.2);
}

/* ── 9. DROPDOWN/MENU ENHANCEMENTS ───────────────────────────────── */
.dropdown-menu,
select {
  transition: all 0.2s ease;
}

.dropdown-item {
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #f0f9ff;
  transform: translateX(4px);
}

/* ── 10. TAB ENHANCEMENTS ─────────────────────────────────────────── */
.nav-link,
.tab-link {
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover,
.tab-link:hover {
  color: #0059bb;
}

.nav-link::after,
.tab-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #0059bb;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.tab-link:hover::after {
  width: 100%;
}

/* ── 11. PAGINATION ENHANCEMENTS ─────────────────────────────────── */
.pagination a,
.pagination button {
  transition: all 0.2s ease;
}

.pagination a:hover,
.pagination button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 89, 187, 0.2);
}

.pagination a:active,
.pagination button:active {
  transform: translateY(0);
}

/* ── 12. SIDEBAR LINK ENHANCEMENTS ───────────────────────────────── */
.admin-sidebar-link,
.sidebar-link {
  transition: all 0.2s ease;
  position: relative;
}

.admin-sidebar-link:hover,
.sidebar-link:hover {
  background: rgba(0, 89, 187, 0.1);
  transform: translateX(4px);
}

.admin-sidebar-link::before,
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: #0059bb;
  transition: height 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.admin-sidebar-link:hover::before,
.sidebar-link:hover::before {
  height: 70%;
}

/* ── 13. IMAGE HOVER ENHANCEMENTS ─────────────────────────────────── */
img {
  transition: transform 0.3s ease;
}

img:hover {
  transform: scale(1.02);
}

/* ── 14. STAT CARD ENHANCEMENTS ─────────────────────────────────── */
.stat-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 89, 187, 0.15);
}

.stat-card:hover .stat-card-value {
  color: #0059bb;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* ── 15. PROGRESS BAR ENHANCEMENTS ─────────────────────────────────── */
.progress-bar {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar:hover {
  filter: brightness(1.1);
}

/* ── 16. ALERT/NOTIFICATION ENHANCEMENTS ─────────────────────────── */
.flash,
.alert {
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.flash-success,
.alert-success {
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1), pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
  }
}

/* ── 17. LOADING SPINNER ENHANCEMENTS ───────────────────────────────── */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── 18. TOOLTIP ENHANCEMENTS ─────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 12px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.75rem;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ── 19. MODAL BACKDROP ENHANCEMENTS ─────────────────────────────── */
.modal-backdrop {
  animation: fadeIn 0.2s ease;
}

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

/* ── 20. SCROLL TO TOP BUTTON ─────────────────────────────────────── */
.scroll-top {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 89, 187, 0.3);
}

/* ── 21. SMOOTH SCROLL ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── 22. FOCUS VISIBLE ENHANCEMENTS ─────────────────────────────────── */
*:focus-visible {
  outline: 2px solid #0059bb;
  outline-offset: 2px;
}

/* ── 23. DISABLED STATE ENHANCEMENTS ─────────────────────────────────── */
button:disabled,
.btn:disabled,
input:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transition: opacity 0.2s ease;
}

button:disabled:hover,
.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ── 24. ACCORDION ENHANCEMENTS ─────────────────────────────────── */
.accordion-item {
  transition: all 0.3s ease;
}

.accordion-item:hover {
  background: #f8fafc;
}

.accordion-button {
  transition: all 0.2s ease;
}

.accordion-button:hover {
  background: #f0f9ff;
}

.accordion-button[aria-expanded="true"] {
  background: #e0f2fe;
}

/* ── 25. TAB PANEL ENHANCEMENTS ─────────────────────────────────────── */
.tab-pane {
  animation: fadeIn 0.3s ease;
}

/* ── 26. NOTIFICATION BOUNCE ─────────────────────────────────────────── */
.notification-badge {
  animation: bounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ── 27. SEARCH INPUT ENHANCEMENTS ─────────────────────────────────── */
.search-input-wrapper {
  transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
  box-shadow: 0 0 0 4px rgba(0, 89, 187, 0.15);
  transform: scale(1.02);
}

/* ── 28. CARD ACTION BUTTONS ─────────────────────────────────────────── */
.card-actions {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .card-actions {
  opacity: 1;
}

/* ── 29. SHIMMER LOADING EFFECT ─────────────────────────────────── */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ── 30. PULSE ANIMATION FOR ATTENTION ─────────────────────────────── */
.pulse-attention {
  animation: pulse-attention 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-attention {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ── 31. FLOATING ACTION BUTTON ─────────────────────────────────────── */
.fab {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 25px rgba(0, 89, 187, 0.4);
}

.fab:active {
  transform: scale(0.95);
}

/* ── 32. SKELETON LOADING ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ── 33. SUCCESS CHECKMARK ANIMATION ─────────────────────────────── */
.success-checkmark {
  animation: success-pop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes success-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── 34. ERROR SHAKE ANIMATION ─────────────────────────────────────── */
.error-shake {
  animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

/* ── 35. HOVER CARD TILT EFFECT ─────────────────────────────────────── */
.tilt-card {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ── 36. GLOW EFFECT ON HOVER ─────────────────────────────────────── */
.glow-hover {
  transition: all 0.3s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 20px rgba(0, 89, 187, 0.5);
}

/* ── 37. SCALE UP ON HOVER ─────────────────────────────────────── */
.scale-up-hover {
  transition: transform 0.3s ease;
}

.scale-up-hover:hover {
  transform: scale(1.05);
}

/* ── 38. ROTATE ON HOVER ─────────────────────────────────────────── */
.rotate-hover {
  transition: transform 0.3s ease;
}

.rotate-hover:hover {
  transform: rotate(5deg);
}

/* ── 39. BORDER GLOW ANIMATION ─────────────────────────────────────── */
.border-glow {
  animation: border-pulse 2s ease-in-out infinite;
}

@keyframes border-pulse {
  0%, 100% {
    border-color: #0059bb;
    box-shadow: 0 0 0 0 rgba(0, 89, 187, 0.4);
  }
  50% {
    border-color: #0059bb;
    box-shadow: 0 0 0 4px rgba(0, 89, 187, 0.2);
  }
}

/* ── 40. TYPING EFFECT ─────────────────────────────────────────────── */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid #0059bb;
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #0059bb;
  }
}
