/* ============================================
   QR Treinamento - Custom CSS
   ============================================ */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F3F4F6;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: #9CA3AF;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #9CA3AF #F3F4F6;
}

/* --- Skeleton Loading --- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #E5E7EB;
  border-radius: 0.5rem;
}
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: skeleton-shimmer 1.5s infinite;
}
@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-text.long { width: 90%; }
.skeleton-circle {
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: 0.75rem;
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: #FFFFFF;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  min-width: 300px;
  max-width: 420px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid transparent;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}
.toast.toast-success { border-left-color: #10B981; }
.toast.toast-error   { border-left-color: #EF4444; }
.toast.toast-warning { border-left-color: #F59E0B; }
.toast.toast-info    { border-left-color: #1484A9; }

.toast .toast-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}
.toast.toast-success .toast-icon { color: #10B981; }
.toast.toast-error   .toast-icon { color: #EF4444; }
.toast.toast-warning .toast-icon { color: #F59E0B; }
.toast.toast-info    .toast-icon { color: #1484A9; }

.toast .toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.4;
}
.toast .toast-close {
  flex-shrink: 0;
  cursor: pointer;
  color: #9CA3AF;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0.25rem;
}
.toast .toast-close:hover { color: #374151; }
.toast .toast-progress {
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 0;
  height: 3px;
  border-radius: 0 0 0.75rem 0;
  animation: toast-progress linear forwards;
}
.toast.toast-success .toast-progress { background: #10B981; }
.toast.toast-error   .toast-progress { background: #EF4444; }
.toast.toast-warning .toast-progress { background: #F59E0B; }
.toast.toast-info    .toast-progress { background: #1484A9; }

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-in       { animation: fadeIn 0.5s ease-out both; }
.animate-fade-in-up    { animation: fadeInUp 0.6s ease-out both; }
.animate-fade-in-down  { animation: fadeInDown 0.5s ease-out both; }
.animate-slide-in-left { animation: slideInLeft 0.5s ease-out both; }
.animate-slide-in-right{ animation: slideInRight 0.5s ease-out both; }
.animate-scale-in      { animation: scaleIn 0.4s ease-out both; }
.animate-pulse-soft    { animation: pulse-soft 2s ease-in-out infinite; }
.animate-float         { animation: float 3s ease-in-out infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.30s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.40s; }

/* --- Card Hover Effects --- */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(14, 66, 123, 0.12), 0 4px 8px -4px rgba(0,0,0,0.06);
}

/* --- Custom Toggle Switch --- */
.toggle-switch {
  position: relative;
  width: 3rem;
  height: 1.625rem;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #D1D5DB;
  border-radius: 9999px;
  transition: background-color 0.3s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 1.25rem;
  width: 1.25rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #38C39D;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(1.375rem);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(56, 195, 157, 0.15);
}

/* --- File Upload Drag & Drop --- */
.file-drop-zone {
  border: 2px dashed #D1D5DB;
  border-radius: 0.75rem;
  padding: 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: #FAFAFA;
}
.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: #38C39D;
  background: rgba(56, 195, 157, 0.05);
}
.file-drop-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(56, 195, 157, 0.10);
}
.file-drop-zone .drop-icon {
  color: #9CA3AF;
  transition: color 0.3s, transform 0.3s;
}
.file-drop-zone:hover .drop-icon,
.file-drop-zone.drag-over .drop-icon {
  color: #38C39D;
  transform: scale(1.1);
}

/* --- Active Navigation --- */
.nav-link {
  position: relative;
  transition: all 0.2s ease;
}
.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: #0E427B;
  border-radius: 0 3px 3px 0;
  transition: height 0.2s ease;
}
.nav-link:hover::before,
.nav-link.active::before {
  height: 60%;
}
.nav-link.active {
  background: rgba(14, 66, 123, 0.06);
  color: #0E427B;
}

/* --- Responsive Table --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
}

/* --- Button Click Feedback --- */
.btn-press {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-press:active {
  transform: scale(0.97);
}

/* --- Confirm Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 9991;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.modal-content.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* --- Password Strength --- */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #E5E7EB;
  overflow: hidden;
  transition: all 0.3s;
}
.strength-bar .strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

/* --- Print Styles --- */
@media print {
  body * {
    visibility: hidden;
  }
  .print-area, .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .no-print {
    display: none !important;
  }
  .qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    page-break-inside: avoid;
  }
  .qr-item {
    text-align: center;
    page-break-inside: avoid;
    border: 1px solid #E5E7EB;
    padding: 0.5rem;
    border-radius: 0.5rem;
  }
  .qr-item img {
    max-width: 150px;
    margin: 0 auto;
  }
}

/* --- Background Floating Shapes (Login Page) --- */
.floating-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.floating-shapes .shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: white;
}
.floating-shapes .shape:nth-child(1) {
  width: 300px; height: 300px;
  top: -100px; left: -50px;
  animation: float 8s ease-in-out infinite;
}
.floating-shapes .shape:nth-child(2) {
  width: 200px; height: 200px;
  bottom: -60px; right: -30px;
  animation: float 6s ease-in-out infinite 1s;
}
.floating-shapes .shape:nth-child(3) {
  width: 150px; height: 150px;
  top: 40%; right: 10%;
  animation: float 7s ease-in-out infinite 2s;
}
.floating-shapes .shape:nth-child(4) {
  width: 100px; height: 100px;
  bottom: 20%; left: 15%;
  animation: float 9s ease-in-out infinite 0.5s;
}

/* --- Mobile-specific --- */
@media (max-width: 768px) {
  #toast-container {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }
  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* --- Loading Spinner --- */
.spinner {
  border: 3px solid rgba(14, 66, 123, 0.15);
  border-top-color: #0E427B;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Upload Progress Bar --- */
.upload-progress {
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0E427B, #1484A9);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, #0E427B, #1484A9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
