/* ===========================================================
   COMPONENTS.CSS - AWS Developer Course Schedule

   Componentes reutilizáveis (módulos, badges, progresso, animações)
   @author Tomas Alric - Cloud Basics
   @version 2.0
   =========================================================== */

/* ===========================================================
   MODULE CARDS
   =========================================================== */

.module {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}

.module:not(.collapsed):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  border-color: var(--border-strong);
}

.module-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-light);
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.module-header:active {
  transform: scale(0.98);
}

.module h2 {
  color: var(--primary);
  font-size: 1.4rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  grid-column: 1;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.module-duration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  min-width: 105px;
  width: 105px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
  grid-column: 2;
  justify-self: end;
  transition: all 0.2s ease;
}

.duration-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.module-header:hover .module-duration {
  background: rgba(13, 148, 136, 0.15);
  border-color: var(--primary);
  transform: scale(1.05);
}

.module-header:hover .duration-icon {
  transform: scale(1.1) rotate(5deg);
}

.module-date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
  white-space: nowrap;
  grid-column: 3;
  justify-self: end;
  transition: all 0.2s ease;
}

.module-date:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(13, 148, 136, 0.4);
}

/* Stagger animation delays */
.module:nth-child(1) { animation-delay: 0.05s; }
.module:nth-child(2) { animation-delay: 0.1s; }
.module:nth-child(3) { animation-delay: 0.15s; }
.module:nth-child(4) { animation-delay: 0.2s; }
.module:nth-child(5) { animation-delay: 0.25s; }
.module:nth-child(6) { animation-delay: 0.3s; }
.module:nth-child(7) { animation-delay: 0.35s; }
.module:nth-child(8) { animation-delay: 0.4s; }
.module:nth-child(9) { animation-delay: 0.45s; }
.module:nth-child(10) { animation-delay: 0.5s; }
.module:nth-child(11) { animation-delay: 0.55s; }
.module:nth-child(12) { animation-delay: 0.6s; }
.module:nth-child(13) { animation-delay: 0.65s; }
.module:nth-child(14) { animation-delay: 0.7s; }
.module:nth-child(15) { animation-delay: 0.75s; }
.module:nth-child(16) { animation-delay: 0.8s; }
.module:nth-child(17) { animation-delay: 0.85s; }
.module:nth-child(18) { animation-delay: 0.9s; }
.module:nth-child(19) { animation-delay: 0.95s; }
.module:nth-child(20) { animation-delay: 1s; }

/* ===========================================================
   ACCORDION/COLLAPSE
   =========================================================== */

.collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  background: rgba(13, 148, 136, 0.15);
  border-radius: 50%;
  font-size: 0.7rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  font-weight: bold;
}

.module-header:hover .collapse-icon {
  background: rgba(13, 148, 136, 0.25);
  transform: scale(1.15);
}

.module:not(.collapsed) .collapse-icon {
  transform: rotate(180deg);
}

.module.collapsed {
  padding: 1.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.module.collapsed .module-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.module table {
  max-height: 10000px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  opacity: 1;
}

.module.collapsed table {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  display: block;
}

/* ===========================================================
   PROGRESS SYSTEM
   =========================================================== */

.module-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0 0;
  margin-top: 1.25rem;
  border-top: 2px solid rgba(13, 148, 136, 0.15);
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(13, 148, 136, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.4);
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-badge.completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  animation: pulse-success 2s ease-in-out infinite;
}

.progress-badge.in-progress {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.progress-badge.not-started {
  background: rgba(100, 116, 139, 0.15);
  color: var(--secondary-light);
}

/* ===========================================================
   CHECKBOXES
   =========================================================== */

td:first-child input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  accent-color: var(--primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 4px;
}

td:first-child input[type="checkbox"]:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

td:first-child input[type="checkbox"]:active {
  transform: scale(0.95);
}

td:first-child input[type="checkbox"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

td:first-child input[type="checkbox"]:checked {
  animation: checkBounce 0.3s ease;
}

tr.completed {
  opacity: 0.65;
  background-color: rgba(16, 185, 129, 0.04);
  transition: all 0.3s ease;
}

tr.completed:hover {
  opacity: 0.8;
}

tr.completed td:not(:first-child) {
  text-decoration: line-through;
  color: #64748b;
}

tr.completed td:first-child {
  text-decoration: none;
}

/* ===========================================================
   BADGES (TYPE INDICATORS)
   =========================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.badge-teoria {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.badge-teoria:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.badge-demo {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-demo:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.badge-lab {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-lab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.badge-quiz {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.badge-quiz:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.badge-projeto,
.badge-projeto-integrador {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.badge-projeto:hover,
.badge-projeto-integrador:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ===========================================================
   MATERIAL LINKS
   =========================================================== */

.material-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.material-link:hover {
  color: #99f6e4;
  border-bottom-color: #99f6e4;
  transform: translateY(-1px);
}

.material-link:visited {
  color: #a78bfa;
}

.material-link:visited:hover {
  color: #c4b5fd;
  border-bottom-color: #c4b5fd;
}

.material-link::after {
  content: "↗";
  font-size: 0.85em;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.material-link:hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

.material-link:active {
  transform: translateY(0);
}

.material-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .material-link {
    font-weight: 600;
    padding: 0.125rem 0;
  }

  .material-link:hover {
    transform: none;
  }

  .material-link::after {
    opacity: 1;
  }

  .material-link:hover::after {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .material-link,
  .material-link::after {
    transition: none;
  }

  .material-link:hover {
    transform: none;
  }

  .material-link:hover::after {
    transform: none;
  }
}

/* ===========================================================
   LOADING STATE
   =========================================================== */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  min-height: 400px;
  animation: fadeIn 0.3s ease;
}

.loading-container.hidden {
  display: none;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(13, 148, 136, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: 1.5rem;
  color: var(--secondary-light);
  font-size: 1rem;
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===========================================================
   ERROR STATE
   =========================================================== */

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  min-height: 400px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.error-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: shake 0.5s ease;
}

.error-title {
  color: #dc2626;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.02em;
}

.error-message {
  color: var(--secondary);
  font-size: 1.1rem;
  margin: 0 0 1.5rem 0;
  max-width: 500px;
  line-height: 1.6;
}

.error-details {
  background: rgba(239, 68, 68, 0.08);
  border: 2px dashed rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin: 1.5rem auto;
  max-width: 600px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  color: #b91c1c;
  text-align: left;
  word-break: break-word;
}

.error-details strong {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #991b1b;
}

.error-suggestions {
  text-align: left;
  margin: 1.5rem auto 0;
  max-width: 500px;
}

.error-suggestions h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 1rem 0;
}

.error-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-suggestions li {
  padding: 0.75rem 0 0.75rem 2rem;
  position: relative;
  color: var(--secondary-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

.error-suggestions li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  margin-top: 1rem;
}

.retry-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.retry-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3);
}

/* ===========================================================
   NO RESULTS MESSAGE
   =========================================================== */

.no-results {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 3rem 2rem;
  text-align: center;
  border: 2px dashed var(--border-strong);
  animation: fadeIn 0.4s ease-out;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results h3 {
  color: var(--secondary);
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
}

.no-results p {
  color: var(--secondary-light);
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
}

.search-no-results {
  background: rgba(239, 68, 68, 0.1);
  border: 2px dashed #ef4444;
}

.search-no-results .no-results-icon {
  color: #ef4444;
}

.reset-filter-btn {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.reset-filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

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

/* ===========================================================
   SCROLL TO TOP BUTTON
   =========================================================== */

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: subtlePulse 2s ease-in-out infinite;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(0.95);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5px;
}

/* ===========================================================
   TRANSITIONS & INTERACTIONS
   =========================================================== */

* {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================================================
   ACCESSIBILITY (A11Y)
   =========================================================== */

*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button,
a,
select {
  min-height: 44px;
  min-width: 44px;
}

/* ===========================================================
   ANIMATIONS (KEYFRAMES)
   =========================================================== */

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

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

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

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

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

@keyframes checkBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse-success {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

@keyframes subtlePulse {
  0%,
  100% {
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
  }
  50% {
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.6);
  }
}

/* ===========================================================
   RESPONSIVE DESIGN - CONSOLIDATED
   =========================================================== */

/* Mobile (até 768px) */
@media (max-width: 768px) {
  main {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }

  header {
    padding: 2rem 1rem;
  }

  .module {
    padding: 1.5rem;
    animation-duration: 0.4s;
  }

  /* Header do módulo - Layout flexível em coluna */
  .module-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  /* Título do módulo - Texto fluindo normalmente */
  .module h2 {
    font-size: 1.1rem !important;
    width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: none !important;
    line-height: 1.3 !important;
  }

  /* Ícone de collapse menor */
  .collapse-icon {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.65rem !important;
  }

  /* Badge de duração - Ajustado */
  .module-duration {
    width: auto !important;
    min-width: auto !important;
    max-width: 100% !important;
    justify-self: flex-start !important;
    font-size: 0.8rem !important;
    padding: 0.375rem 0.75rem !important;
  }

  /* Badge de data - Ajustado */
  .module-date {
    justify-self: flex-start !important;
    font-size: 0.8rem !important;
    padding: 0.5rem 1rem !important;
  }

  /* Controles */
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-left,
  .controls-right {
    width: 100%;
    justify-content: stretch;
  }

  .controls label {
    font-size: 0.95rem;
  }

  .controls select {
    font-size: 0.95rem;
    width: 100%;
    flex: 1;
  }

  .action-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  /* Progresso */
  .module-progress {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .progress-text {
    text-align: left;
  }

  /* Tabela - Card Layout com fundo escuro */
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
  }

  tr:nth-child(even) {
    background: rgba(13, 148, 136, 0.03);
  }

  td {
    border: none;
    position: relative;
    padding: 0.75rem 0.75rem 0.75rem 45%;
    text-align: right;
    color: var(--secondary);
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: 40%;
    font-weight: 700;
    text-align: left;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
  }

  td:first-child {
    padding: 0.75rem;
    text-align: center;
  }

  td:first-child::before {
    display: none;
  }

  td:not(:last-child) {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
  }

  tbody tr:hover {
    background-color: var(--bg-hover);
  }

  tbody tr:active {
    background-color: rgba(13, 148, 136, 0.1);
  }

  tr.completed {
    opacity: 0.65;
    background-color: rgba(16, 185, 129, 0.04);
  }

  /* Badges com cor garantida */
  .badge {
    color: white !important;
  }

  .badge-teoria {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
  }

  .badge-demo {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
  }

  .badge-lab {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
  }

  .badge-quiz {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: white !important;
  }

  .badge-projeto {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
  }

  /* Desabilitar hovers no mobile */
  .module:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  }

  .module-header:hover,
  .module-header:hover .collapse-icon,
  .module-header:hover .module-duration,
  .module-header:hover .duration-icon {
    transform: none !important;
  }

  .badge:hover,
  .action-btn:hover,
  .logo:hover,
  .module-date:hover {
    transform: none !important;
  }

  td:first-child input[type="checkbox"]:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .scroll-to-top:hover {
    transform: translateY(0) !important;
  }

  /* Feedback visual ao tocar (active) */
  .module-header:active {
    background: rgba(13, 148, 136, 0.08);
    border-radius: var(--radius-md);
  }

  .action-btn:active {
    transform: scale(0.97);
    filter: brightness(0.95);
  }

  .scroll-to-top:active {
    transform: scale(0.92);
  }

  td:first-child input[type="checkbox"]:active {
    transform: scale(0.9);
  }

  .scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }

  .loading-container {
    padding: 3rem 1rem;
    min-height: 300px;
  }

  .loading-spinner {
    width: 50px;
    height: 50px;
    border-width: 3px;
  }

  .loading-text {
    font-size: 0.9rem;
  }

  .error-container {
    padding: 3rem 1.5rem;
    min-height: 300px;
  }

  .error-icon {
    font-size: 4rem;
  }

  .error-title {
    font-size: 1.4rem;
  }

  .error-message {
    font-size: 1rem;
  }

  .retry-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Tablet (769px até 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  main {
    max-width: 90%;
  }

  .module {
    padding: 1.75rem;
  }
}

/* Reduced Motion (Acessibilidade) */
@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;
  }

  .module {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ===========================================================
   DISABLE HOVER ON TOUCH DEVICES
   =========================================================== */

@media (hover: none) {
  .module:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .module-header:hover,
  .module-header:hover .collapse-icon,
  .module-header:hover .module-duration,
  .module-header:hover .duration-icon {
    transform: none;
  }

  .badge:hover,
  .action-btn:hover,
  .logo:hover,
  .footer-logo:hover,
  .scroll-to-top:hover,
  .module-date:hover {
    transform: none;
  }

  td:first-child input[type="checkbox"]:hover {
    transform: none;
    box-shadow: none;
  }

  tbody tr:hover {
    background-color: transparent;
  }
}

/* ===========================================================
   DISABLE TAP HIGHLIGHT (MOBILE)
   =========================================================== */

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

button,
a,
select,
input[type="checkbox"],
.module-header {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
