/* === Dr. Promptshake v7.5.2 — Layout === */

/* iOS Safe Area */
header, .header {
  padding-top: calc(env(safe-area-inset-top, 20px) + 10px) !important;
  background-color: #0a0a0a !important;
}

.chat-input-container {
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 10px) !important;
}

/* === Login === */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #0a0a0a 0%, #141414 100%);
}

.login-box {
  background: var(--bg-secondary);
  padding: 60px 50px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(10px);
}

.login-box h1 {
  margin-bottom: 8px;
  font-size: 26px;
  font-weight: 300;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.login-logo {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  filter: brightness(1.1) saturate(1.2);
}

/* === App Shell === */

.app-container {
  display: none;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

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

.logo-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 12px;
  transition: opacity var(--transition-med);
}

.logo-button:hover { opacity: 0.85; }

.brain-logo {
  width: 203px;
  height: 203px;
  filter: brightness(1.15) contrast(1.1) saturate(1.2);
  margin: -58px -16px -58px 0;
}

.app-title {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--gold);
  white-space: nowrap;
}

.menu-trigger {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  color: var(--text-primary);
  transition: all var(--transition-med);
  border-radius: 8px;
}

.menu-trigger:hover { background: rgba(255, 255, 255, 0.05); }

.menu-dots {
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
}

/* ============================================
   NOTE EDITOR — redesigned per requirements
   - 30% taller
   - text vertically centered
   - send button on lighter field, symmetric
   ============================================ */

.note-editor {
  background: var(--bg-secondary);
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  transition: border-color var(--transition-med), box-shadow var(--transition-med);
}

.note-editor:focus-within {
  border-color: rgba(212, 199, 158, 0.35);
  box-shadow: 0 0 16px rgba(212, 199, 158, 0.08);
}

.note-editor textarea {
  flex: 1;
  min-height: 60px;
  padding: 16px 16px;
  background: transparent;
  border: none;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
  resize: none;
  line-height: 1.6;
  font-weight: 300;
  overflow-y: auto;
  max-height: 400px;
}

.note-editor textarea::placeholder {
  color: var(--text-secondary);
}

.note-editor textarea:focus {
  outline: none;
}

/* Send button — sticks to bottom-right */
.note-editor .actions {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: flex-end;
}

.note-editor .btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #2a2520, #1a1714);
  border: 1.5px solid rgba(212, 199, 158, 0.3);
  color: var(--gold);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-med);
  padding: 0;
  line-height: 1;
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(212, 199, 158, 0.15);
}

.note-editor .btn-send svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
  filter: drop-shadow(0 0 4px rgba(212, 199, 158, 0.3));
}

.note-editor .btn-send:hover {
  background: linear-gradient(145deg, #332d26, #221c16);
  border-color: var(--gold);
  box-shadow: 
    0 0 16px var(--gold-glow),
    0 2px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(212, 199, 158, 0.2);
  transform: scale(1.05);
}

.note-editor .btn-send:active {
  transform: scale(0.95);
  box-shadow: 
    0 0 8px var(--gold-glow),
    inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ============================================
   NOTES LIST — padding fix (shift right)
   ============================================ */

.notes-list {
  background: var(--bg-secondary);
  padding: 8px 0;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.notes-list h3 {
  display: none;
}

#dayNotesPlaceholder {
  padding: 0;
}

/* ============================================
   CALENDAR VIEW (Miesiąc tab)
   ============================================ */

.calendar-container {
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  animation: fadeIn 0.3s var(--ease-out);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
}

.calendar-header h3 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.calendar-nav-btn:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Day-of-week header */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Day grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  border: 1px solid transparent;
}

.calendar-day:hover:not(.empty):not(.other-month) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.other-month {
  opacity: 0.25;
  cursor: default;
}

/* Today — mint highlight */
.calendar-day.today {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  border-color: var(--accent);
}

.calendar-day.today:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Day with notes — gold glow */
.calendar-day.has-notes:not(.today) {
  background: var(--gold-subtle);
  color: var(--gold);
  border-color: var(--gold-glow);
  font-weight: 500;
}

.calendar-day.has-notes:not(.today):hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}

/* Today + has notes */
.calendar-day.today.has-notes {
  box-shadow: 0 0 12px var(--accent-glow), inset 0 0 0 1px rgba(255,255,255,0.15);
}

/* Selected day */
.calendar-day.selected:not(.today) {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* Note count dot */
.calendar-day .note-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.calendar-day.today .note-dot {
  background: rgba(255,255,255,0.7);
}

/* Notes preview below calendar */
.calendar-notes-preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.2s var(--ease-out);
}

.calendar-notes-preview .preview-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 400;
}

/* ============================================
   TECZKI PRIV (Knowledge Base view)
   ============================================ */

.teczki-container {
  animation: fadeIn 0.3s var(--ease-out);
}

.teczki-header {
  margin-bottom: 24px;
}

.teczki-header h3 {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.teczki-header p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
}

.teczki-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.teczki-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  cursor: pointer;
  transition: all var(--transition-med);
  display: flex;
  align-items: center;
  gap: 16px;
}

.teczki-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.teczki-card:active {
  transform: translateY(0);
}

.teczki-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 22px;
  flex-shrink: 0;
}

.teczki-card-icon.mint { background: var(--accent-subtle); }
.teczki-card-icon.gold { background: var(--gold-subtle); }
.teczki-card-icon.neutral { background: rgba(255,255,255,0.05); }

.teczki-card-body {
  flex: 1;
  min-width: 0;
}

.teczki-card-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.teczki-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 300;
}

.teczki-card-count {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
}

/* Teczki detail modal */
.teczki-detail {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
  animation: slideUp 0.3s var(--ease-out);
}

.teczki-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.teczki-detail-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

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

.teczki-detail-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 300;
}

.teczki-detail-item:last-child {
  border-bottom: none;
}

.teczki-detail-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* Week panel (legacy, kept for compat) */
.week-panel {
  display: flex;
  min-height: 300px;
  background: transparent;
}

.week-days-list {
  width: 70px;
  min-width: 70px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Month picker */
.month-picker-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 15px;
  transition: all var(--transition-med);
}

.month-picker-btn:hover {
  border-color: var(--border-hover);
}
