/* ==========================================================================
   MMC WORKS - UNIFIED DESIGN SYSTEM & STYLESHEET
   Paleta: #100F14 (Fundo), #202024 (Cards/Modais), #E6E6EA (Texto Principal),
           #919195 (Texto Secundário), #6E6E70 (Bordas de Inputs), #00c8ff (Ciano)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   1. VARIÁVEIS GLOBAIS E RESET CSS
   ========================================================================== */
:root {
  /* Cores Principais */
  --bg-main: #100F14;
  --bg-card: #202024;
  --bg-card-hover: #26262b;
  --text-primary: #E6E6EA;
  --text-secondary: #919195;
  --border-subtle: #2a2a30;
  --border-input: #6E6E70;

  /* Cores de Destaque e Status */
  --accent-cyan: #00c8ff;
  --accent-cyan-glow: rgba(0, 200, 255, 0.18);
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;

  /* Tipografia & Dimensões (Fonte Poppins) */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-height: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   2. BOTÕES E COMPONENTES REUTILIZÁVEIS
   ========================================================================== */
.btn {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--accent-cyan);
  color: #0b0b0f;
}

.btn-primary:hover {
  background-color: #38d3ff;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.btn-publish {
  background-color: var(--accent-success);
  color: #ffffff;
}

.btn-publish:hover {
  background-color: #059669;
}

.btn-draft {
  background-color: #3f3f46;
  color: var(--text-primary);
  border: 1px solid var(--border-input);
}

.btn-draft:hover {
  background-color: #52525b;
}

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

.btn-secondary:hover {
  background-color: #2b2b32;
  border-color: #4b4b56;
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: var(--accent-danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ==========================================================================
   3. CABEÇALHO & NAVEGAÇÃO DO PORTFÓLIO PÚBLICO
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: #100F14; /* Fundo fixo #100F14 */
  z-index: 100;
  border-bottom: none;
}

.header-container {
  max-width: 1800px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

/* Logotipo MMC Works */
.brand-logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.brand-logo-img {
  height: 48px; /* Aumentado em 30% conforme solicitado */
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Filtros de Menu à Direita */
.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-filters {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700; /* Peso da fonte bold conforme solicitado */
  letter-spacing: 0.2px;
  cursor: pointer;
  padding: 8px 4px;
  position: relative;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
}

.filter-btn:hover {
  opacity: 1;
  color: #ffffff;
}

.filter-btn.active {
  font-weight: 700;
  opacity: 1;
  color: var(--accent-cyan);
}

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-cyan);
  border-radius: 2px;
}

/* Ícones de Redes Sociais (Sem bordas conforme solicitado) */
.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: none; /* Bordas removidas conforme solicitado */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.social-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.social-icon:hover {
  background-color: #2d2d34;
  transform: translateY(-2px);
  color: var(--accent-cyan);
}

.admin-badge-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.admin-badge-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

/* Menu Hambúrguer & Gaveta Mobile */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}

.hamburger-btn svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 15, 20, 0.98);
  backdrop-filter: blur(20px);
  z-index: 105;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.mobile-nav-filters .filter-btn {
  font-size: 20px;
  font-weight: 700;
}

.mobile-socials {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.mobile-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   4. GRID DE THUMBNAILS DO PORTFÓLIO PÚBLICO
   ========================================================================== */
.portfolio-main {
  max-width: 1800px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 16px) 40px 80px; /* 16px de espaçamento abaixo da navbar fixa */
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 colunas padrão */
  gap: 5px; /* Espaçamento reduzido para 5px conforme solicitado */
  width: 100%;
}

.project-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* Thumbnail quadrado */
  min-width: 0;
  background-color: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: none;
}

.project-card:hover {
  /* Efeito de subir removido conforme solicitado - posição estática */
  border: none;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px 20px 16px;
  background: linear-gradient(to top, rgba(16, 15, 20, 0.95) 0%, rgba(16, 15, 20, 0.6) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.18s ease; /* Fade suave e rápido apenas do título */
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.card-tag-badge {
  color: var(--accent-cyan);
  font-weight: 600;
}

.empty-grid-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   5. MODAL DE VISUALIZAÇÃO DE PROJETO (Layout de Referência)
   ========================================================================== */
.project-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 9, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 40px 20px;
}

.project-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 1600px;
  display: grid;
  grid-template-columns: 1fr 380px; /* Galeria à esquerda, Cards à direita */
  gap: 16px;
  margin: 30px auto;
  padding-top: 0;
  align-items: start; /* Alinha topo das imagens com o topo do card de título */
}

/* Coluna de Mídias Verticais */
.modal-media-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 0;
}

.modal-media-item {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: transparent;
  box-shadow: none; /* Sombra projetada removida conforme solicitado */
  transition: border-radius 0.2s ease;
}

.modal-media-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Suporte a Bordas Retas (Straight Corners) vs Arredondadas */
.modal-media-column.straight-corners .modal-media-item,
.modal-media-column.straight-corners .modal-media-item img,
.modal-media-column.straight-corners .video-container,
.modal-media-column.straight-corners .video-container iframe {
  border-radius: 0px !important;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Coluna Lateral de Informações */
.modal-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 30px;
  margin-top: 0;
  height: fit-content;
}

.modal-card {
  position: relative;
  background-color: var(--bg-card); /* #202024 */
  border-radius: 12px;
  padding: 24px;
  border: none; /* Removida a linha de borda conforme solicitado */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Cabeçalho do Card de Título com Botão Fechar no Canto Superior Direito */
.modal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-right: 32px; /* Espaço para o botão de fechar */
}

.modal-card-header .project-modal-title {
  margin-bottom: 0;
  flex: 1;
}

.modal-card-close-btn {
  position: absolute;
  top: 14px;
  right: 14px; /* Mesma distância (14px) das bordas superior e lateral */
  background-color: var(--bg-card); /* Mesma cor de fundo do card */
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  z-index: 2;
}

.modal-card-close-btn:hover {
  background-color: #27272e;
  border-color: #4b4b56;
  color: var(--accent-cyan);
  transform: scale(1.08);
}

.modal-card-close-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Tipografia do Modal */
.project-modal-title {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: var(--text-primary); /* #E6E6EA */
  margin-bottom: 16px;
}

.project-modal-desc {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: #e6e6ea;
  text-align: left;
  margin-bottom: 24px;
}

.project-desc-link {
  color: var(--accent-cyan, #00c8ff);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.project-desc-link:hover {
  color: #8be4f7;
  opacity: 0.9;
  text-decoration: underline;
}

.project-modal-date {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: #8c8c90;
}

.modal-tags-title {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.modal-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: var(--text-primary); /* #E6E6EA */
  background-color: var(--bg-card);
  border: 1px solid #3c3c44;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s ease;
}

.tag-badge:hover {
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   5.1. MODAL ABOUT ME (Conforme Imagem de Referência)
   ========================================================================== */
.about-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease; /* Fade suave e rápido */
}

.about-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.about-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-card); /* #202024 */
  border-radius: 14px;
  padding: 28px 28px 24px;
  border: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

.about-modal-backdrop.open .about-modal-card {
  transform: scale(1);
  opacity: 1;
}

.about-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.about-modal-title {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--text-primary); /* #E6E6EA */
}

.about-modal-close-btn {
  background-color: var(--bg-card);
  border: 1px solid #44444e;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.about-modal-close-btn:hover {
  background-color: #2c2c34;
  border-color: #666672;
  color: var(--accent-cyan);
  transform: scale(1.06);
}

.about-modal-text {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  color: var(--text-primary); /* #E6E6EA */
  margin-bottom: 24px;
  text-align: left;
}

.about-modal-footer {
  display: flex;
  align-items: center;
}

.about-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   6. PAINEL ADMINISTRATIVO: AUTENTICAÇÃO E DASHBOARD
   ========================================================================== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 36px 32px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-logo .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input, .form-textarea, .form-select {
  background-color: var(--bg-main); /* #100F14 */
  border: 1px solid var(--border-input); /* #6E6E70 */
  color: var(--text-primary); /* #E6E6EA */
  font-family: var(--font-family);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Tipografias Específicas nos Inputs */
.input-project-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 22px !important;
  color: #E6E6EA !important;
}

.input-project-desc {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  color: #919195 !important;
  min-height: 100px;
  resize: vertical;
}

.input-project-date {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  color: #919195 !important;
}

/* Estrutura do App Admin */
.admin-app {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.admin-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.admin-nav-link:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  gap: 5px;
  transition: all 0.2s ease;
}

.admin-hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

.admin-hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.admin-hamburger-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.admin-hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.admin-mobile-user-info,
.admin-mobile-live-link {
  display: none;
}

.admin-main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title-group h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-title-group p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Tabela de Projetos */
.projects-table-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.projects-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.projects-table th {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.projects-table td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle; /* Alinhamento vertical centralizado com toda a linha */
}

.projects-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Coluna de Ordem (Subir / Descer) */
.table-order-cell {
  width: 70px;
  text-align: center;
  vertical-align: middle;
}

.table-order-controls {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.btn-order {
  background: #141318;
  border: 1px solid #36363e;
  color: var(--text-primary);
  width: 28px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-order:hover:not(:disabled) {
  background: #25242c;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-order:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  border-color: #26262c;
}

.table-thumb-col {
  width: 90px;
  vertical-align: middle;
}

.table-thumb-img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #100F14;
  border: 1px solid var(--border-subtle);
  display: block;
}

.table-title-cell h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.table-title-cell p {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.badge-published {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-draft {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.table-tags-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 200px;
}

.table-tag-item {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background-color: #16151a;
  border: 1px solid #33333b;
  padding: 2px 6px;
  border-radius: 4px;
}

.table-actions-cell {
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.table-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ==========================================================================
   7. MODAL DE EDIÇÃO E CADASTRO DE PROJETOS
   ========================================================================== */
.editor-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 9, 13, 0.88);
  backdrop-filter: blur(12px);
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.editor-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.editor-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 1000px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.editor-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.editor-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.editor-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.editor-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Gerenciador de Tags com # */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-input);
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 46px;
}

.tag-chip {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: #E6E6EA;
  background-color: var(--bg-card);
  border: 1px solid #3c3c44;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-chip-remove {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: bold;
}

.tag-chip-remove:hover {
  color: var(--accent-danger);
}

.tag-text-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  flex: 1;
  min-width: 120px;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.preset-tag-btn {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-tag-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Slider de Espaçamento Customizado (1 a 100px) */
.spacing-control-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  border-radius: 8px;
}

.spacing-slider {
  flex: 1;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.spacing-val-display {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 55px;
  text-align: right;
}

/* Option Pills (Modo de Envio e Estilo de Bordas) */
.option-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.option-pill-label {
  position: relative;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.option-pill-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.2s ease;
  background: transparent;
}

.option-pill-label input[type="radio"]:checked + .option-pill-btn {
  background-color: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.option-pill-label:hover .option-pill-btn {
  color: var(--text-primary);
}

/* Seção de Thumbnail e Uploads */
.thumb-picker-wrapper {
  display: flex;
  gap: 20px;
  align-items: center;
}

.thumb-preview-box {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-input);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.thumb-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lista de Reordenação de Imagens */
.images-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.image-reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-main);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: 8px;
  gap: 14px;
}

.image-reorder-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  overflow: hidden;
}

.image-reorder-thumb {
  width: 80px;
  height: 45px; /* 16:9 */
  border-radius: 4px;
  object-fit: cover;
  background-color: #0b0b0e;
  border: 1px solid var(--border-subtle);
}

.image-reorder-meta {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-reorder-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border-subtle);
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   8. FERRAMENTA DE RECORTE INTERATIVO (CROPPER CANVAS)
   ========================================================================== */
.cropper-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 9, 13, 0.94);
  backdrop-filter: blur(16px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto; /* Rolagem vertical habilitada caso a tela seja pequena */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cropper-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.cropper-modal-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 720px;
  max-height: 92vh; /* Não ultrapassa a altura da janela */
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  margin: auto;
}

.cropper-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cropper-title {
  font-size: 15px;
  font-weight: 700;
}

.cropper-badge {
  font-size: 11px;
  color: var(--accent-cyan);
  background: rgba(0, 200, 255, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.cropper-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.cropper-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-y: auto; /* Rolagem interna automática */
  max-height: calc(92vh - 120px);
}

.cropper-canvas-wrapper {
  position: relative;
  background-color: #0b0b0e;
  border: 2px solid var(--accent-cyan);
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.cropper-guide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cropper-grid-lines {
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}

.cropper-controls {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cropper-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}

.cropper-control-row label {
  font-weight: 600;
  white-space: nowrap;
  font-size: 12px;
}

.cropper-control-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-cyan);
  cursor: pointer;
  height: 6px;
}

.btn-cropper-step {
  background: var(--bg-main);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.btn-cropper-step:hover {
  background: #272730;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.cropper-px-input-wrapper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 2px 6px;
  gap: 3px;
  flex-shrink: 0;
}

.cropper-px-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

.cropper-px-input {
  width: 60px;
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  outline: none;
}

.cropper-px-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cropper-hints {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.cropper-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* ==========================================================================
   9. NOTIFICAÇÕES (TOASTS)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.toast-success {
  border-left: 4px solid var(--accent-success);
}

.toast-error {
  border-left: 4px solid var(--accent-danger);
}

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

/* ==========================================================================
   10. RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 1400px) {
  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 miniaturas por coluna/linha conforme solicitado */
  }
  .modal-container {
    grid-template-columns: 1fr;
  }
  .modal-sidebar-column {
    position: static;
  }
  .modal-card-header {
    padding-right: 0;
  }
  .modal-card-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    width: 38px;
    height: 38px;
    background-color: rgba(32, 32, 36, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none !important; /* Sem borda na versão mobile/responsiva */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  }
  .modal-card-close-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 20px;
  }
  .nav-filters, .social-links, .admin-badge-link {
    display: none;
  }
  .hamburger-btn {
    display: block;
  }
  .portfolio-main {
    padding: calc(var(--header-height) + 16px) 16px 60px;
  }
  .projects-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 colunas de imagens no layout mobile responsivo */
    gap: 5px;
  }
  .project-card {
    min-width: 0;
    border-radius: 6px;
    border: none;
  }
  .project-card-overlay {
    display: none;
  }
  .project-modal-backdrop {
    padding: 30px 12px 20px;
  }
  .modal-card-header {
    padding-right: 0; /* Título ocupa largura total no mobile */
  }
  .modal-card-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    width: 38px;
    height: 38px;
    background-color: rgba(32, 32, 36, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none !important; /* Sem borda na versão mobile/responsiva */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  }
  .modal-card-close-btn svg {
    width: 16px;
    height: 16px;
  }
  /* Admin Header Responsive & Hamburger Menu */
  .admin-header {
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .admin-nav-links {
    display: none;
  }
  .admin-hamburger-btn {
    display: flex;
  }
  .admin-header-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: rgba(28, 28, 30, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 20px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
  }
  .admin-header-right.open {
    display: flex;
    animation: adminMenuSlide 0.2s ease forwards;
  }
  @keyframes adminMenuSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .admin-mobile-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .admin-mobile-live-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
  }
  .admin-mobile-live-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
  }
  .admin-header-right button {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  /* Admin Main & Botão Inserir Novo Projeto abaixo da descrição à esquerda */
  .admin-main {
    padding: 20px 16px 60px;
  }
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }
  .page-title-group {
    width: 100%;
  }
  #btn-new-project {
    align-self: flex-start;
  }

  .editor-grid-2 {
    grid-template-columns: 1fr;
  }
  .projects-table th:nth-child(4),
  .projects-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 colunas de imagens em telas compactas */
    gap: 5px;
  }
}
