@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: radial-gradient(ellipse at 50% 0%, #F7B2D0 0%, #F0E6D3 60%); background-attachment: fixed; overflow: hidden; }
body { display: flex; justify-content: center; align-items: flex-start; font-family: 'Nunito', sans-serif; }

#app { width: 100%; max-width: 430px; height: 100svh; position: relative; overflow: hidden; box-shadow: 0 0 80px rgba(0,0,0,0.25); }

/* ====== SCREENS ====== */
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; background: #FFF8F0; transition: transform 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.38s ease; display: flex; flex-direction: column; will-change: transform; }
.screen.active    { transform: translateX(0);    opacity: 1; z-index: 2; pointer-events: all; }
.screen.slide-left  { transform: translateX(-100%); opacity: 0; z-index: 1; pointer-events: none; }
.screen.slide-right { transform: translateX(100%);  opacity: 0; z-index: 1; pointer-events: none; }

/* ====== LOADING ====== */
#loading-screen { position: fixed; inset: 0; background: linear-gradient(160deg, #E91E8C 0%, #9C27B0 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 300; transition: opacity 0.5s ease, visibility 0.5s ease; }
#loading-screen.hide { opacity: 0; visibility: hidden; }
.loading-icon { font-size: 72px; display: block; margin-bottom: 18px; animation: bounce 0.9s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-12px) scale(1.08); } }
.loading-text { font-size: 22px; font-weight: 800; color: rgba(255,255,255,0.9); }

/* ====== HOME HEADER ====== */
.app-header { background: linear-gradient(150deg, #E91E8C 0%, #AD1457 100%); padding: 28px 24px 48px; text-align: center; position: relative; flex-shrink: 0; }
.app-header::after { content: ''; position: absolute; bottom: -22px; left: 0; right: 0; height: 44px; background: #FFF8F0; border-radius: 50% 50% 0 0 / 44px 44px 0 0; }

.btn-admin-shortcut {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  z-index: 10;
}
.btn-admin-shortcut:hover { background: rgba(255, 255, 255, 0.35); }
.btn-admin-shortcut:active { transform: scale(0.9); }
.app-logo { font-size: 56px; display: block; margin-bottom: 8px; animation: wiggle 4s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.app-title { font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.app-subtitle { font-size: 16px; color: rgba(255,255,255,0.88); margin-top: 6px; font-weight: 600; }

/* ====== FAVORITOS PREVIEW (home) ====== */
#fav-preview-section { padding: 32px 16px 0; flex-shrink: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 22px; font-weight: 900; color: #2D1B00; }
.btn-ver-todos { background: none; border: none; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; color: #E91E8C; cursor: pointer; padding: 4px 0; }
.fav-preview-list { display: flex; flex-direction: column; gap: 10px; }
.fav-mini-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 3px 12px rgba(0,0,0,0.08); border: 1.5px solid #F5EDE0; cursor: pointer; transition: transform 0.15s; }
.fav-mini-card:active { transform: scale(0.97); }
.fav-mini-icon { font-size: 28px; flex-shrink: 0; }
.fav-mini-info { flex: 1; min-width: 0; }
.fav-mini-title { font-size: 17px; font-weight: 800; color: #2D1B00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-mini-cat   { font-size: 13px; font-weight: 600; color: #9E7B65; margin-top: 2px; }
.fav-mini-heart { font-size: 20px; color: #E53935; flex-shrink: 0; }

/* ====== CATEGORIES ====== */
.section-title-standalone { font-size: 22px; font-weight: 900; color: #2D1B00; padding: 16px 20px 14px; flex-shrink: 0; }
#categories-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 16px 50px; }
.category-card { border-radius: 22px; padding: 24px 14px 20px; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease; display: flex; flex-direction: column; align-items: center; text-align: center; border: none; background: var(--card-bg); position: relative; overflow: hidden; min-height: 158px; justify-content: center; box-shadow: 0 5px 20px rgba(0,0,0,0.10); -webkit-user-select: none; user-select: none; }
.category-card::before { content: ''; position: absolute; top: -22px; right: -22px; width: 80px; height: 80px; background: rgba(255,255,255,0.3); border-radius: 50%; }
.category-card:active { transform: scale(0.94); }
.cat-icon  { font-size: 48px; display: block; margin-bottom: 12px; line-height: 1; position: relative; z-index: 1; }
.cat-name  { font-size: 17px; font-weight: 900; color: #2D1B00; position: relative; z-index: 1; }
.cat-count { font-size: 13px; font-weight: 700; color: rgba(45,27,0,0.55); margin-top: 5px; position: relative; z-index: 1; }

/* ====== STICKY HEADERS ====== */
.sticky-header { position: sticky; top: 0; z-index: 20; }
.cat-header { padding: 14px 18px; display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 2px solid #F0E6D3; box-shadow: 0 2px 8px rgba(0,0,0,0.06); flex-shrink: 0; }
.project-header { padding: 14px 18px; display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 2px solid #F0E6D3; box-shadow: 0 2px 8px rgba(0,0,0,0.06); flex-shrink: 0; }
.btn-back { background: #FFF0F6; border: 2px solid #F8BBD9; color: #E91E8C; border-radius: 50%; width: 48px; height: 48px; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s, transform 0.15s; font-family: 'Nunito', sans-serif; }
.btn-back:active { background: #F8BBD9; transform: scale(0.93); }
.cat-header-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.cat-header-icon { font-size: 30px; }
.cat-header-name { font-size: 21px; font-weight: 900; color: #2D1B00; }
.project-header-label { font-size: 15px; font-weight: 800; color: #9E7B65; flex: 1; }

/* Botao favorito no header do projeto */
.heart-btn-header { background: none; border: none; font-size: 28px; cursor: pointer; padding: 4px; transition: transform 0.2s; color: #BDBDBD; flex-shrink: 0; }
.heart-btn-header.favorited { color: #E53935; animation: heartPop 0.3s ease; }
@keyframes heartPop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* ====== BANNER DA CATEGORIA — oculto ====== */
.cat-banner { display: none; }

/* ====== THUMBNAIL / FRAME DO VIDEO no card do projeto ====== */
.project-thumb {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin: 12px 0 16px;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #F0E6D3;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.project-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.project-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
}
.project-thumb-placeholder .pin-label {
  font-size: 14px; font-weight: 800;
  color: rgba(255,255,255,0.9);
  font-family: 'Nunito', sans-serif;
}
/* Overlay com botao play — removido */
.project-thumb-play { display: none; }
.play-circle { display: none; }

/* ====== PROJECTS LIST ====== */
#projects-list { padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 14px; }
.project-card { background: #fff; border-radius: 20px; padding: 20px 20px 20px; box-shadow: 0 4px 18px rgba(0,0,0,0.09); border: 1.5px solid #F5EDE0; transition: transform 0.18s ease; animation: slideUp 0.35s ease both; position: relative; }
.project-card:active { transform: scale(0.98); }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.10s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.20s; }

/* Botao favorito no card */
.heart-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #FFF8F0;
  border: 2px solid #F0E6D3;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #BDBDBD;
  flex-shrink: 0;
  z-index: 2;
}
.heart-btn.favorited { background: #FFEBEE; border-color: #FFCDD2; color: #E53935; animation: heartPop 0.3s ease; }
.heart-btn:active { transform: scale(0.9); }

.project-number { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; font-weight: 900; color: #fff; margin-bottom: 12px; box-shadow: 0 3px 8px rgba(0,0,0,0.18); }
.project-title { font-size: 21px; font-weight: 900; color: #2D1B00; margin-bottom: 8px; line-height: 1.3; padding-right: 46px; }
.project-desc  { font-size: 17px; font-weight: 500; color: #6D5040; line-height: 1.55; margin-bottom: 18px; }
.btn-ver-projeto { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px 20px; color: #fff; border: none; border-radius: 60px; font-size: 19px; font-weight: 900; cursor: pointer; font-family: 'Nunito', sans-serif; transition: opacity 0.18s, transform 0.15s; box-shadow: 0 5px 18px rgba(0,0,0,0.18); -webkit-user-select: none; user-select: none; }
.btn-ver-projeto:active { opacity: 0.82; transform: scale(0.97); }

/* ====== VIDEO ====== */
#project-video-section { background: #0a0a0a; flex-shrink: 0; }
#project-video-wrapper { width: 100%; background: #0a0a0a; }
.video-ratio-box { width: 100%; aspect-ratio: 16/9; background: #000; position: relative; overflow: hidden; }
.video-ratio-box iframe, .video-ratio-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; object-fit: contain; }
.video-auto-container { width: 100%; background: #000; display: flex; justify-content: center; }
.video-auto-container video { width: 100%; max-height: 75svh; display: block; object-fit: contain; }
.pinterest-embed-wrap { position: relative; overflow: hidden; width: 100%; background: #0a0a0a; display: flex; justify-content: center; }
.pin-footer-cover { position: absolute; bottom: 0; left: 0; right: 0; background: #0a0a0a; z-index: 30; pointer-events: all; }
.no-video-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: #1a1a1a; color: rgba(255,255,255,0.5); gap: 10px; }
.no-video-placeholder span { font-size: 48px; }
.no-video-placeholder p { font-size: 18px; font-weight: 700; }
.video-loading { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 48px 20px; background: #0a0a0a; color: rgba(255,255,255,0.6); font-size: 18px; font-weight: 700; }
.video-spinner { font-size: 36px; animation: spin 1.2s linear infinite; display: block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ====== PROJECT CONTENT ====== */
#project-page-content { padding: 20px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.project-page-title { font-size: 26px; font-weight: 900; color: #2D1B00; line-height: 1.3; }
.section-card { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 4px 18px rgba(0,0,0,0.08); border: 1.5px solid #F5EDE0; }
.section-card-title { font-size: 20px; font-weight: 900; color: #2D1B00; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-icon { font-size: 22px; }
.project-desc-text { font-size: 18px; font-weight: 500; color: #5D4037; line-height: 1.6; }
.materials-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.materials-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 18px; font-weight: 600; color: #3E2723; line-height: 1.4; }
.mat-check { width: 28px; height: 28px; background: #E8F5E9; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; color: #2E7D32; font-weight: 900; margin-top: 1px; }
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.step-item { display: flex; align-items: flex-start; gap: 14px; }
.step-number { width: 36px; height: 36px; border-radius: 50%; background: var(--cat-color, #E91E8C); color: #fff; font-size: 18px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 3px 8px rgba(0,0,0,0.15); margin-top: 2px; }
.step-text { font-size: 18px; font-weight: 600; color: #3E2723; line-height: 1.55; }
.btn-pinterest-extra { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 17px 20px; background: linear-gradient(135deg, #E60023, #C8001F); color: #fff; border-radius: 60px; font-size: 18px; font-weight: 900; text-decoration: none; box-shadow: 0 5px 18px rgba(230,0,35,0.28); font-family: 'Nunito', sans-serif; transition: opacity 0.18s, transform 0.15s; }
.btn-pinterest-extra:active { opacity: 0.85; transform: scale(0.97); }

/* ====== FAVORITOS SCREEN ====== */
.favorites-list { padding: 16px 16px 60px; display: flex; flex-direction: column; gap: 10px; }
.fav-group-label { font-size: 16px; font-weight: 900; color: #9E7B65; padding: 8px 4px 4px; text-transform: uppercase; letter-spacing: 1px; }
.fav-project-card { background: #fff; border-radius: 18px; padding: 18px 18px 18px; box-shadow: 0 3px 14px rgba(0,0,0,0.08); border: 1.5px solid #F5EDE0; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: transform 0.15s; }
.fav-project-card:active { transform: scale(0.97); }
.fav-card-icon { font-size: 30px; flex-shrink: 0; }
.fav-card-info { flex: 1; min-width: 0; }
.fav-card-title { font-size: 18px; font-weight: 800; color: #2D1B00; line-height: 1.3; }
.fav-card-cat   { font-size: 14px; font-weight: 600; color: #9E7B65; margin-top: 3px; }
.fav-card-remove { background: none; border: none; font-size: 22px; cursor: pointer; color: #E53935; padding: 4px; flex-shrink: 0; transition: transform 0.15s; }
.fav-card-remove:active { transform: scale(0.85); }
.fav-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 30px; text-align: center; color: #BDBDBD; gap: 14px; }
.fav-empty-state .big-icon { font-size: 64px; }
.fav-empty-state .big-text { font-size: 20px; font-weight: 800; color: #BDBDBD; }
.fav-empty-state .small-text { font-size: 16px; font-weight: 600; color: #BDBDBD; line-height: 1.5; }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233,30,140,0.22); border-radius: 2px; }