/* ============================================
   PHASE 7: ANIMATIONS & POLISH
   ============================================ */

/* Keyframe Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Alert Animations */
.alert {
  animation: slideInDown 0.4s ease-out !important;
}

.alert {
  transition: opacity 0.3s ease;
}

/* Page Load Animation */
.main-content {
  animation: fadeIn 0.3s ease-out;
}

.sidebar {
  animation: slideInLeft 0.3s ease-out;
}

.top-bar {
  animation: slideInDown 0.3s ease-out;
}

/* Smooth Transitions */
body * {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

button,
.btn,
.nav-link,
.action-btn,
.filter-link {
  transition: all 0.3s ease !important;
}

/* Button Hover Effects */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.btn-primary:hover {
  opacity: 0.95;
}

.btn-secondary:hover {
  opacity: 0.95;
}

.btn-danger:hover {
  opacity: 0.95;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

/* Link Hover Effects */
a {
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Form Focus States */
.form-control:focus {
  border-color: #2563eb;
  box-shadow: none;
  outline: none;
  transition: all 0.3s ease;
}

.form-control {
  transition: border-color 0.3s ease;
}

.form-control:hover {
  /* No hover color change */
}

/* Table Row Hover Effects */
tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  /* No hover color change */
}

/* Navigation Link Active State */
.nav-link.active {
  animation: slideInUp 0.3s ease-out;
}

/* Modal Animations */
.modal {
  animation: fadeIn 0.3s ease-out;
}

.modal.show {
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  animation: slideInUp 0.3s ease-out;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Spinner/Loading Indicator */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(37, 99, 235, 0.2);
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top: 2px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Empty State Styling */
.empty-state {
  animation: slideInUp 0.4s ease-out;
  text-align: center;
  padding: 3rem 2rem;
  color: #a0aec0;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
  animation: bounce 2s ease-in-out infinite;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: #a0aec0;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Badge Animations */
.badge {
  animation: slideInUp 0.3s ease-out;
}

/* Card Hover Effects */
.card,
.setting-card,
.stat-card,
.profile-section,
.payslip-card,
.leave-item,
.document-item {
  transition: all 0.3s ease;
}

.card:hover,
.setting-card:hover,
.payslip-card:hover {
  /* No hover color change */
}

.stat-card:hover {
  /* No hover effect */
}

/* Notification Bell Animation */
.bell-button {
  transition: all 0.3s ease;
}

.bell-button:hover {
  transform: scale(1.1);
}

.badge:not(:empty) {
  animation: pulse 2s ease-in-out infinite;
}

/* Error State Animation */
.form-control.error {
  border-color: #ef4444;
  animation: shake 0.3s ease;
}

.form-control.error:focus {
  box-shadow: none;
}

/* Success State Animation */
.form-control.success {
  border-color: #10b981;
}

.form-control.success:focus {
  box-shadow: none;
}

/* Confirmation Dialog */
.confirmation-dialog {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: none;
  animation: slideInUp 0.3s ease-out;
}

.confirmation-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.confirmation-message {
  color: #cbd5e1;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirmation-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(16, 185, 129, 0.9);
  backdrop-filter: blur(10px);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: slideInRight 0.3s ease-out;
  z-index: 1000;
  max-width: 300px;
  box-shadow: none;
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.9);
  border-color: rgba(245, 158, 11, 0.3);
}

.toast.info {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(37, 99, 235, 0.3);
}

.toast.exit {
  animation: slideInLeft 0.3s ease-in;
}

@media (max-width: 768px) {
  .toast {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* Transition Helper Classes */
.transition-fast {
  transition: all 0.15s ease;
}

.transition-normal {
  transition: all 0.3s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

/* Opacity States */
.opacity-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.opacity-hover:hover {
  /* No hover effect */
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Disabled Button State */
button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

/* Focus Ring for Accessibility */
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Form Input Validation Feedback */
.form-feedback {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  animation: slideInUp 0.3s ease-out;
}

.form-feedback.error {
  color: #ef4444;
}

.form-feedback.success {
  color: #10b981;
}

.form-feedback.warning {
  color: #f59e0b;
}

/* Data Table Loading State */
.table-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  z-index: 999;
  animation: slideInRight 0.3s ease-out;
}

/* Tooltip Styling */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  background-color: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -50px;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Breadcrumb Animations */
.breadcrumb {
  animation: slideInDown 0.3s ease-out;
}

.breadcrumb-item {
  transition: color 0.2s ease;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

/* Loading Bar for Long Operations */
.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Staggered List Item Animation */
.list-item:nth-child(1) { animation-delay: 0.05s; }
.list-item:nth-child(2) { animation-delay: 0.1s; }
.list-item:nth-child(3) { animation-delay: 0.15s; }
.list-item:nth-child(4) { animation-delay: 0.2s; }
.list-item:nth-child(5) { animation-delay: 0.25s; }
.list-item:nth-child(6) { animation-delay: 0.3s; }
.list-item:nth-child(7) { animation-delay: 0.35s; }
.list-item:nth-child(8) { animation-delay: 0.4s; }
.list-item:nth-child(9) { animation-delay: 0.45s; }
.list-item:nth-child(10) { animation-delay: 0.5s; }

.list-item {
  animation: slideInUp 0.3s ease-out;
}
