/* ==========================================================================
   xmeet Recording Suite - Modals & Overlays System
   Instituto Anarriê & X Capital
   ========================================================================== */

/* ── 1. Modal de Confirmação Customizado (Glassmorphism) ── */
.custom-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.custom-modal-card {
  position: relative;
  background: linear-gradient(180deg, rgba(23, 31, 49, 0.98), rgba(15, 20, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 92%;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 0, 0, 0.5);
  transform: scale(0.92) translateY(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.custom-modal-overlay.open .custom-modal-card {
  transform: scale(1) translateY(0);
}

.custom-modal-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.custom-modal-glow.danger {
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
}

.custom-modal-glow.warning {
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}

.custom-modal-glow.info {
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.custom-modal-icon-container {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-icon-container.danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.22);
}

.custom-modal-icon-container.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.22);
}

.custom-modal-icon-container.info {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 24px var(--primary-glow);
}

.custom-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.custom-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  white-space: pre-line;
}

.custom-modal-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
}

.custom-modal-btn {
  flex: 1;
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-danger-custom {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: 1px solid #f43f5e;
  color: #fff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35);
}

.btn-danger-custom:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
  transform: translateY(-1px);
}

.btn-warning-custom {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #f59e0b;
  color: #fff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-warning-custom:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: 1px solid var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

/* ── Tela / Modal de Login Master ── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080c16;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.2) 0, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.15) 0, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0, transparent 55%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.login-overlay.authenticated {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  position: relative;
  max-width: 440px;
  width: 90%;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2.75rem 2.25rem 2.25rem;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 50px -15px rgba(99, 102, 241, 0.3);
  overflow: hidden;
  animation: loginCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.login-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--cyan), transparent);
}

.login-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-logo-img {
  max-height: 90px;
  max-width: 240px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.25));
  margin-bottom: 0.85rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #c7d2fe;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-input-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.login-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 0.4rem;
}

.login-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.login-input {
  width: 100%;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(11, 15, 25, 0.95);
}

.btn-toggle-eye {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-toggle-eye:hover {
  color: #fff;
}

.login-alert-error {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  color: #fda4af;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  text-align: left;
}

.login-alert-error.visible {
  display: flex;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-submit-login {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: var(--transition);
}

.btn-submit-login:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.login-footer-text {
  font-size: 0.74rem;
  color: var(--text-subtle);
  margin-top: 1.5rem;
  text-align: center;
}

@keyframes login-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.login-card.shake {
  animation: login-shake 0.4s ease-in-out;
}

/* ── 2. Modal de Ata & Inteligência Artificial (Gemini) ── */

/* ── Modal IA ─────────────────────────────────────────── */
.ai-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.ai-modal-overlay.open {
  display: flex;
}

.ai-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 860px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  animation: aiSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aiSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.09), rgba(17, 24, 39, 0.97));
}

.ai-modal-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ai-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 16px var(--primary-glow);
  flex-shrink: 0;
}

.ai-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.ai-modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.ai-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.ai-modal-close:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
}

/* Tabs */
.ai-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 2rem;
  background: var(--bg-surface);
  gap: 0.25rem;
}

.ai-tab {
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}

.ai-tab:hover {
  color: var(--text-main);
}

.ai-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ai-tab-content {
  display: none;
  padding: 2rem;
  min-height: 280px;
}

.ai-tab-content.active {
  display: block;
}

/* Summary */
.ai-summary-body {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-main);
}

.ai-summary-body h2,
.ai-summary-body h3 {
  color: var(--primary);
  margin: 1.2rem 0 0.5rem;
  font-size: 0.95rem;
}

/* Action Items */
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.action-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.action-item-priority {
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.priority-alta {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
}

.priority-media {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

.priority-baixa {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
}

.action-item-body {
  flex: 1;
}

.action-item-task {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.action-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Transcript */
.ai-transcript-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ai-processing-state,
.ai-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.ai-processing-state .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.ai-modal-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

/* Botão IA nos cards */
.btn-ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--primary);
}

.btn-ai:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.18));
  border-color: var(--primary);
  box-shadow: 0 4px 16px var(--primary-glow);
}