/* ============================================
   MecaLab3D - Shared Components
   Navbar, Footer, Buttons, Cards, Forms
   ============================================ */

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition-base), padding var(--transition-base), box-shadow var(--transition-base);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 0;
  box-shadow: 0 1px 0 var(--border);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-decoration: none;
  z-index: 1001;
}

.navbar__logo span {
  color: var(--accent-primary);
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  letter-spacing: 0.02em;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

.navbar__link:hover,
.navbar__link.active {
  color: var(--text-primary);
}

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
}

.navbar__cta {
  margin-left: 1rem;
}

/* Mobile menu toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 1001;
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform var(--transition-base), opacity var(--transition-base);
  display: block;
}

.navbar__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar__toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .navbar__toggle {
    display: flex;
  }

  .navbar__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    transition: right var(--transition-smooth);
  }

  .navbar__nav.open {
    right: 0;
  }

  .navbar__link {
    font-size: 1.5rem;
  }

  .navbar__cta {
    margin-left: 0;
  }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0, 113, 227, 0.3);
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(0, 113, 227, 0.5);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn--secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-primary);
  padding: 0.5rem 1rem;
}

.btn--ghost:hover {
  background: var(--accent-subtle);
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn--success {
  background: var(--success);
  color: #000;
}

.btn--danger {
  background: var(--danger);
  color: var(--text-primary);
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card:hover {
  border-color: rgba(0, 113, 227, 0.35);
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 113, 227, 0.15), 0 0 20px rgba(0, 113, 227, 0.08);
  background: var(--bg-elevated);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  color: var(--accent-primary);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.card__text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card__tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input--error {
  border-color: var(--danger);
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
}

.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge--pendente {
  background: rgba(255, 171, 0, 0.15);
  color: var(--warning);
}

.badge--analise {
  background: rgba(41, 121, 255, 0.15);
  color: var(--info);
}

.badge--aprovado {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge--recusado {
  background: rgba(255, 23, 68, 0.15);
  color: var(--danger);
}

.badge--imprimindo {
  background: rgba(0, 163, 255, 0.15);
  color: var(--accent-glow);
}

.badge--enviado {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge--concluido {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* ========== SECTION HEADERS ========== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header__tag {
  display: inline-block;
  padding: 0.35rem 1.15rem;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.25);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section-header__title {
  margin-bottom: 1rem;
}

.section-header__desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ========== DIVIDERS ========== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

.divider--accent {
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.6;
}

.footer__heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--accent-primary);
}

.footer__socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer__social {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer__social:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-subtle);
}

.footer__social svg {
  width: 18px;
  height: 18px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__security {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__security svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ========== LOADING / SPINNER ========== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ========== TOAST / NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 380px;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info { border-left: 3px solid var(--info); }

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

/* ========== MODAL ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.modal__close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ========== TABLES ========== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--bg-tertiary);
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state__text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
