/* ============================================================
   PetrarcaWorkspace — Shared Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Cormorant:ital,wght@0,400;0,600;1,400;1,600&display=swap');

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

:root {
  --bg:        #0d0c0b;
  --bg2:       #131110;
  --bg3:       #1a1714;
  --surface:   #1e1b18;
  --border:    rgba(255,255,255,0.07);
  --red:       #c0392b;
  --red-dim:   #9b2d20;
  --red-glow:  rgba(192,57,43,0.18);
  --white:     #f0ece6;
  --grey:      #8a8078;
  --grey2:     #5a5248;
  --text:      #d4cec6;
  --serif:     'Cormorant Garamond', Georgia, serif;
  --serif2:    'Cormorant', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Navbar ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  background: rgba(13,12,11,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--white);
}

.nav-logo img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-logo .logo-fallback {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: #fff;
}

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

.nav-links a {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--grey);
  transition: color .2s;
}
.nav-links a:hover { color: var(--white); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  border: none;
}

.btn-red {
  background: var(--red);
  color: #fff;
}
.btn-red:hover { background: #a93226; }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }

/* ── Utility ── */
.red { color: var(--red); }
.italic { font-style: italic; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px; right: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  color: var(--white);
  font-family: var(--serif);
  font-size: 15px;
  padding: 14px 20px;
  border-radius: 4px;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left-color: #27ae60; }

/* ── User dropdown ── */
.user-menu { position: relative; }

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px 5px 5px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--white);
  letter-spacing: 0.03em;
}
.user-avatar-btn:hover { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.03); }

.user-avatar-img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.user-avatar-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  font-family: var(--serif);
  letter-spacing: 0;
  flex-shrink: 0;
}

.user-chevron {
  width: 12px; height: 12px;
  opacity: 0.5;
  transition: transform .2s;
}
.user-menu.open .user-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 200;
}
.user-menu.open .user-dropdown { display: block; }

.dropdown-header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.dropdown-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.dropdown-email {
  font-size: 12px;
  color: var(--grey);
  word-break: break-all;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--grey);
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  letter-spacing: 0.02em;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.dropdown-item.danger { color: #e74c3c; }
.dropdown-item.danger:hover { background: rgba(231,76,60,0.1); color: #e74c3c; }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
