/* layout.css */

/* Cabeçalho */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--gradient-header);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.app-title {
  margin: 0;
  font-size: 1.1rem;
}

.app-subtitle {
  font-size: 0.75rem;
  opacity: 0.85;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 999px;
  padding: 2px;
}

.nav-link {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  color: #e5e7eb;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.nav-link.active {
  background: #ffffff;
  color: #4338ca;
  transform: translateY(-1px);
}

.header-right {
  display: flex;
  gap: 8px;
}

.header-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  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;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* Conteúdo principal */
.app-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 16px auto 24px;
  padding: 0 12px 24px;
}

/* Painéis genéricos */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Layout das notas (3 blocos em grid) */
.notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "groups notes"
    "editor editor";
  gap: 16px;
}

.groups-panel {
  grid-area: groups;
}

.notes-panel {
  grid-area: notes;
}

.editor-panel {
  grid-area: editor;
}

/* Responsivo */
@media (max-width: 900px) {
  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "groups"
      "notes"
      "editor";
  }
}

@media (max-width: 700px) {
  .app-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .app-main {
    padding: 8px 10px 20px;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .main-nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav-link {
    flex: 1;
    text-align: center;
  }
}