/* =============================================================
   PREMIUM ETAPAS 4-8 — Refinamento Visual
   AuroraTechno Academy / Dev Invisível™
   
   Modais, UX Refinada, Responsividade Extrema, Efeitos Cinematográficos
   ============================================================= */

/* ── MODAIS PREMIUM ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(0, 217, 255, 0.15);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn var(--transition-smooth) ease-out;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glow);
}

.modal-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-button);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-main);
  border-color: var(--cyan);
  background: rgba(0, 217, 255, 0.1);
}

.modal-body {
  margin-bottom: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border-glow);
}

/* ── LOADING STATES ── */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 217, 255, 0.1);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.spinner-small {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-glass), var(--bg-glass-strong), var(--bg-glass));
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-card);
}

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

.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── TOAST / FEEDBACK ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 40px rgba(0, 217, 255, 0.2);
  animation: toastSlideIn var(--transition-smooth) ease-out;
  min-width: 320px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.15);
}

.toast.error {
  border-color: rgba(255, 51, 102, 0.3);
  box-shadow: 0 0 40px rgba(255, 51, 102, 0.15);
}

.toast.warning {
  border-color: rgba(255, 214, 0, 0.3);
  box-shadow: 0 0 40px rgba(255, 214, 0, 0.15);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
}

/* ── EMPTY STATES ── */
.empty-state {
  text-align: center;
  padding: 60px 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-glow);
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.03), rgba(122, 92, 255, 0.03));
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

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

.empty-state-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-state-message {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.empty-state-action {
  display: inline-block;
}

/* ── ERROR STATES ── */
.error-box {
  background: rgba(255, 51, 102, 0.08);
  border: 1px solid rgba(255, 51, 102, 0.25);
  border-radius: var(--radius-card);
  padding: 16px;
  color: rgba(255, 51, 102, 0.9);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.error-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── INTERACTIVE STATES ── */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.2) !important;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ── HOVER / ACTIVE / FOCUS ── */
.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.2);
  transition: all var(--transition-smooth);
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn:hover {
  box-shadow: 0 0 30px rgba(47, 107, 255, 0.3);
  transform: translateY(-2px);
}

.ghost-btn:active {
  background: var(--bg-glass-strong);
}

/* ── RESPONSIVIDADE EXTREMA ── */

/* 360px — Celular pequeno */
@media (max-width: 360px) {
  .page {
    padding: 12px;
  }

  .card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .form-card {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(20px, 5vw, 28px);
  }

  h2 {
    font-size: clamp(16px, 3vw, 22px);
  }

  .btn, .primary-btn, .secondary-btn, .ghost-btn {
    width: 100%;
    padding: 12px 16px;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .toast {
    min-width: 280px;
    right: 12px;
    bottom: 12px;
  }

  .navbar {
    padding: 0 16px;
  }

  .navbar-links {
    display: none;
  }

  .navbar-mobile-toggle {
    display: flex;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual {
    display: none;
  }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-header {
    flex-wrap: wrap;
  }

  .admin-search {
    display: none;
  }
}

/* 390px — iPhone 12/13 */
@media (max-width: 390px) {
  .grid {
    grid-template-columns: 1fr !important;
  }

  .form input,
  .form textarea,
  .form select {
    font-size: 16px; /* Previne zoom em inputs */
  }
}

/* 414px — iPhone XR/11 */
@media (max-width: 414px) {
  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    gap: 16px;
  }

  .admin-tabs {
    flex-wrap: wrap;
  }

  .admin-tabs button {
    flex: 1;
    min-width: 100px;
  }
}

/* 768px — Tablet */
@media (max-width: 768px) {
  .page {
    padding: 16px;
  }

  .card {
    padding: 24px;
  }

  .hero-section {
    padding: 80px 24px 40px;
  }

  .hero-container {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: flex;
    margin-top: 32px;
  }

  .holo-stage {
    width: min(300px, 50vw);
    height: min(320px, 55vw);
  }

  .navbar {
    padding: 0 24px;
  }

  .navbar-links {
    gap: 4px;
  }

  .navbar-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .admin-sidebar {
    width: 240px;
  }

  .admin-main {
    margin-left: 240px;
  }

  .admin-header {
    padding: 16px 24px;
  }

  .admin-search {
    width: 200px;
  }

  .admin-list {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 90%;
    max-width: 500px;
  }

  .toast-container {
    bottom: 16px;
    right: 16px;
  }

  .toast {
    min-width: 300px;
  }
}

/* 1024px — Tablet grande / Desktop pequeno */
@media (max-width: 1024px) {
  .hero-container {
    gap: 40px;
  }

  .admin-sidebar {
    width: 260px;
  }

  .admin-main {
    margin-left: 260px;
  }

  .admin-list {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* 1200px+ — Desktop */
@media (min-width: 1200px) {
  .page {
    padding: 32px;
  }

  .card {
    padding: 40px;
  }

  .admin-sidebar {
    width: 280px;
  }

  .admin-main {
    margin-left: 280px;
  }

  .admin-list {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }

  .hero-container {
    gap: 80px;
  }
}

/* ── ACESSIBILIDADE VISUAL ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── DARK MODE (já padrão) ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #02030a;
    --bg-panel: rgba(8, 15, 35, 0.82);
  }
}

/* ── PRINT ── */
@media print {
  .navbar,
  .admin-sidebar,
  .admin-header,
  .modal-overlay,
  .toast-container,
  .no-print {
    display: none !important;
  }

  .page,
  .card {
    background: white;
    color: black;
    border: none;
    box-shadow: none;
  }

  body {
    background: white;
  }
}

/* ── TRATAMENTO HOLOGRÁFICO DA LOGO ── */
/* Remove o fundo preto e integra a logo ao ambiente dark luxury */
img.logo-oficial, 
img.main-logo, 
.navbar-logo img, 
.login-logo img, 
.preinscricao-logo img,
.admin-sidebar-logo img,
.brand-logo,
.ats-logo-holo-main {
  mix-blend-mode: screen; /* Remove o preto e mantém as cores claras/neon */
  filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 15px rgba(0, 217, 255, 0.4));
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ajuste específico para garantir que não haja bordas ou caixas */
.logo-wrap, .login-logo, .preinscricao-logo, .admin-sidebar-logo {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
}

/* ── SUBPÁGINAS DO ALUNO (ETAPA 4.2 - 4.4) ── */
.prompt-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-button);
  padding: 16px;
  margin: 12px 0;
  font-family: 'Fira Code', monospace;
  position: relative;
  overflow: hidden;
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-copy-neon {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-copy-neon:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 15px var(--cyan);
}

.pdf-viewer-container {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  overflow: hidden;
  margin-top: 20px;
}

/* ── PAGAMENTO PIX E UPLOAD (ETAPA 5.4 - 5.5) ── */
.pix-qr-container {
  background: #fff;
  padding: 15px;
  border-radius: 12px;
  display: inline-block;
  margin: 20px 0;
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
  border: 4px solid var(--cyan);
}

.upload-dropzone {
  border: 2px dashed var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  background: rgba(0, 217, 255, 0.03);
  transition: all 0.3s;
  cursor: pointer;
}

.upload-dropzone:hover {
  border-color: var(--cyan);
  background: rgba(0, 217, 255, 0.08);
}

/* ── LOADING & SKELETONS (ETAPA 6.3) ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

/* ── ESTADOS VAZIOS (ETAPA 6.4) ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 50px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.5));
  opacity: 0.6;
}

/* ── ADMIN MOBILE (ETAPA 7.4) ── */
@media (max-width: 768px) {
  .admin-table-responsive thead { display: none; }
  .admin-table-responsive tr {
    display: block;
    margin-bottom: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    padding: 15px;
  }
  .admin-table-responsive td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .admin-table-responsive td::before {
    content: attr(data-label);
    font-weight: bold;
    color: var(--cyan);
  }
}
