/* layout.css */

/* ============================================
   HEADER
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--gradient-header);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.3);
  transition: background 0.4s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-circle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.header-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.app-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.app-subtitle {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* ============================================
   NAVEGAÇÃO CENTRAL
   ============================================ */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}

.main-nav {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.nav-link {
  border: none;
  border-radius: 999px;
  padding: 7px 22px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background: #ffffff;
  color: #4338ca;
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BOTÕES DO HEADER
   ============================================ */
.header-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* ============================================
   MAIN CONTENT — mais largo no desktop
   ============================================ */
.app-main {
  flex: 1;
  /* Aumentado de 1100px para 1400px */
  max-width: 1400px;
  width: 100%;
  margin: 20px auto 36px;
  padding: 0 20px 36px;
}

/* ============================================
   PAINÉIS
   ============================================ */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.section-header h2 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================
   GRID DE NOTAS
   ============================================ */
.notes-grid {
  display: grid;
  /* Grupos menor, Notas maior */
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "groups notes"
    "editor editor";
  gap: 20px;
}

.groups-panel { grid-area: groups; }
.notes-panel  { grid-area: notes; }
.editor-panel { grid-area: editor; }

/* Desktop grande: mais espaço ainda */
@media (min-width: 1400px) {
  .app-main {
    max-width: 1600px;
    padding: 0 32px 40px;
  }

  .notes-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(0, 2.2fr);
    gap: 24px;
  }

  .panel {
    padding: 24px;
  }
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 900px) {
  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "groups"
      "notes"
      "editor";
    gap: 14px;
  }
}

@media (max-width: 700px) {
  .app-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 0;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
  }

  .app-main {
    padding: 8px 12px 28px;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .nav-link {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
  }

  .header-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .app-title {
    font-size: 1rem;
  }

  .app-subtitle {
    display: none;
  }
}