
:root {
  --bg: #f8f5ee;
  --ink: #2c2520;
  --muted: #887e73;
  --accent: #a56c58;
  --line: #e6ded3;
  --white: #fffdfa;
  --sidebar-width: 280px;
  --sidebar-closed: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.hidden { display: none !important; }

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0 0 12px;
}

.muted { color: var(--muted); }

.message {
  color: var(--accent);
  font-size: 13px;
  margin-top: 12px;
  min-height: 16px;
  overflow-wrap: anywhere;
}

.primary, .secondary {
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: .2s ease;
}

.primary { background: var(--accent); color: white; }

.primary:hover {
  background: #895743;
  transform: translateY(-1px);
}

.secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}

.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.full { width: 100%; }

/* GİRİŞ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 15px 45px rgba(44,37,32,.06);
}

.monogram {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1e6dc;
  color: var(--accent);
  font-size: 25px;
  margin-bottom: 25px;
}

.login-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 12px;
}

.login-card form, .modal-card form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-card > .secondary { margin-top: 12px; }

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

input, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border .2s;
}

input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

/* ANA UYGULAMA */

.app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: clip;
}

/* SOL MENÜ */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 var(--sidebar-closed);
  width: var(--sidebar-closed);
  min-width: var(--sidebar-closed);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border-right: 1px solid var(--line);
  transition:
    flex-basis .35s cubic-bezier(.22,.61,.36,1),
    width .35s cubic-bezier(.22,.61,.36,1),
    min-width .35s cubic-bezier(.22,.61,.36,1),
    box-shadow .3s ease;
}

.sidebar:hover {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  box-shadow: 8px 0 25px rgba(44,37,32,.07);
}

.sidebar-header {
  position: relative;
  flex: 0 0 75px;
  height: 75px;
  min-width: var(--sidebar-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  transition: padding .3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  white-space: nowrap;
}

.brand-mark { color: var(--accent); font-size: 25px; }

.sidebar-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  display: none;
}

.sidebar-hamburger {
  position: absolute;
  top: 13px;
  left: 8px;
  width: 46px;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: var(--ink);
  border: none;
  border-radius: 10px;
  font-size: 27px;
  z-index: 5;
  opacity: 1;
  visibility: visible;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.sidebar-hamburger:hover {
  background: #f4e9df;
  color: var(--accent);
}

.sidebar-content {
  flex: 1;
  min-width: var(--sidebar-width);
  padding: 25px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease, transform .3s ease, padding .3s ease;
}

.sidebar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin: 16px 8px 12px;
  white-space: nowrap;
}

.sidebar-create, .sidebar-menu-btn, .album-item {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 9px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.sidebar-create:hover, .sidebar-menu-btn:hover, .album-item:hover {
  border-color: var(--accent);
  background: #fbf4ed;
  color: var(--accent);
}

.nav-icon {
  width: 22px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  flex-shrink: 0;
}

.nav-text { white-space: nowrap; }

.sidebar-divider {
  height: 1px;
  background: var(--line);
  margin: 20px 4px;
}

.album-list { display: grid; gap: 8px; }

.album-item {
  margin: 0;
  min-width: 0;
  padding: 10px;
}

.album-item.active {
  background: #f4e9df;
  border-color: #dfc7b7;
  color: var(--accent);
}

.album-select {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.album-icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-size: 20px;
}

.album-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-mini-actions { display: flex; align-items: center; gap: 4px; }

.mini-action {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--muted);
}

.mini-action:hover { color: var(--accent); border-color: var(--accent); }
.mini-action.delete:hover { color: #b74747; border-color: #b74747; }

.sidebar-count {
  margin-left: auto;
  background: #f1e6dc;
  color: var(--accent);
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 12px;
}

.sidebar-bottom {
  min-width: var(--sidebar-width);
  padding: 15px 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 1;
  visibility: visible;
  transition: opacity .25s ease, padding .3s ease;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #f8f2eb;
}

.user-avatar, .member-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ead8ca;
  color: var(--accent);
  font-size: 20px;
}

.user-info {
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
}

.user-info strong { font-size: 13px; }

.user-info span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

.sidebar-logout:hover { color: var(--accent); border-color: var(--accent); }

/* KAPALI MENÜ - ÜÇ İKON */

@media (min-width: 701px) {
  .sidebar:not(:hover) .sidebar-header {
    min-width: var(--sidebar-closed);
    width: var(--sidebar-closed);
    padding: 0;
    justify-content: center;
  }

  .sidebar:not(:hover) .sidebar-header .brand { display: none; }

  .sidebar:not(:hover) .sidebar-hamburger {
    position: absolute;
    top: 13px;
    left: 8px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar:not(:hover) .sidebar-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 9px;
    width: var(--sidebar-closed);
    min-width: var(--sidebar-closed);
    padding: 10px 9px;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .sidebar:not(:hover) .sidebar-label,
  .sidebar:not(:hover) .sidebar-divider,
  .sidebar:not(:hover) #albumList,
  .sidebar:not(:hover) #membersBtn { display: none !important; }

  .sidebar:not(:hover) #createAlbumBtn,
  .sidebar:not(:hover) #joinAlbumBtn {
    display: flex !important;
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--accent);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar:not(:hover) #createAlbumBtn .nav-icon,
  .sidebar:not(:hover) #joinAlbumBtn .nav-icon {
    display: flex;
    width: 46px;
    min-width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    color: var(--accent);
  }

  .sidebar:not(:hover) #createAlbumBtn .nav-text,
  .sidebar:not(:hover) #joinAlbumBtn .nav-text { display: none !important; }

  .sidebar:not(:hover) .sidebar-bottom {
    width: var(--sidebar-closed);
    min-width: var(--sidebar-closed);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar:hover .sidebar-hamburger {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar:hover .sidebar-header {
    min-width: var(--sidebar-width);
    padding: 0 22px;
  }

  .sidebar:hover .sidebar-header .brand { display: flex; }

  .sidebar:hover .sidebar-content {
    display: block;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 25px 16px;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    overflow-y: auto;
  }

  .sidebar:hover .sidebar-label,
  .sidebar:hover #albumList,
  .sidebar:hover #membersBtn { display: block; }

  .sidebar:hover #createAlbumBtn,
  .sidebar:hover #joinAlbumBtn {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    margin: 0 0 9px;
    padding: 11px 13px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }

  .sidebar:hover #createAlbumBtn .nav-icon,
  .sidebar:hover #joinAlbumBtn .nav-icon {
    width: 22px;
    min-width: 22px;
  }

  .sidebar:hover #createAlbumBtn .nav-text,
  .sidebar:hover #joinAlbumBtn .nav-text { display: inline; }

  .sidebar:hover .sidebar-bottom {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 15px 16px 20px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* ANA İÇERİK */

.main-content {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  padding: 0 5.5%;
  overflow: hidden;
}

.topbar {
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.topbar-left { display: flex; align-items: center; gap: 15px; }
.menu-toggle { display: none; border: none; background: transparent; font-size: 25px; color: var(--ink); }
.mobile-brand { display: none; }
.user-label { color: var(--muted); font-size: 13px; }

/* HERO */

.hero {
  min-height: 330px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 30px;
}

.hero-copy h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.13;
  margin: 0 0 18px;
}

.hero-copy h1 em { color: var(--accent); font-weight: 500; }

.hero-copy > p:last-child {
  color: var(--muted);
  line-height: 1.7;
  max-width: 420px;
}

.hero-art {
  width: 230px;
  height: 230px;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
}

.art-circle {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: #eee0d2;
}

.art-note {
  position: relative;
  transform: rotate(-7deg);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(44,37,32,.09);
  padding: 25px;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
}

/* TOOLBAR */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 40px 0 25px;
}

.toolbar h2 {
  font-family: 'Playfair Display', serif;
  font-size: 29px;
  font-weight: 500;
  margin: 0;
}

.count {
  display: inline-block;
  vertical-align: middle;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  background: #eee4da;
  color: var(--accent);
  border-radius: 20px;
  padding: 5px 9px;
  margin-left: 8px;
}

.toolbar-actions { display: flex; gap: 10px; }

/* GALERİ */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding-bottom: 50px;
}

.empty {
  text-align: center;
  padding: 65px 20px;
  border: 1px dashed #d9c9ba;
  border-radius: 16px;
  margin: 20px 0;
}

.empty-heart { color: var(--accent); font-size: 40px; }

.empty h3 {
  font-family: 'Playfair Display', serif;
  font-size: 25px;
  font-weight: 500;
}

.empty p { color: var(--muted); }

.memory-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.memory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(44,37,32,.08);
}

.memory-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
}

.memory-info { padding: 15px; }
.memory-date { color: var(--accent); font-size: 11px; margin-bottom: 7px; }

.memory-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 8px;
}

.memory-info p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.memory-actions { display: flex; gap: 8px; padding-top: 10px; }

.memory-actions button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--muted);
}

.memory-actions button:hover { border-color: var(--accent); color: var(--accent); }

/* ÜYELER */

.members-list { display: grid; gap: 10px; margin-top: 20px; }

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f2eb;
  border-radius: 10px;
}

.member-details { min-width: 0; flex: 1; display: grid; gap: 3px; }
.member-details strong { font-size: 13px; overflow-wrap: anywhere; }
.member-owner { color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; }

/* FOOTER */

footer {
  border-top: 1px solid var(--line);
  padding: 25px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}

footer span { color: var(--accent); }

/* MODALLAR */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44,37,32,.45);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 35px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.modal-card h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 29px;
  margin: 0 0 18px;
}

.close {
  position: absolute;
  top: 13px;
  right: 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

.close:hover { color: var(--accent); }

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

.preview-wrap { border-radius: 10px; overflow: hidden; }

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

/* HESAP AYARLARI */

.settings-card { max-width: 560px; }

.settings-intro {
  font-size: 13px;
  margin: -8px 0 18px;
  line-height: 1.6;
}

.settings-card form { gap: 15px; }

.settings-section-title {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.settings-card label { gap: 7px; }

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(25,20,17,.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px 20px 25px;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 5px;
}

.lightbox #lightboxCaption {
  color: white;
  margin-top: 15px;
  text-align: center;
}

.light-close { color: white; top: 20px; right: 25px; }

/* MOBİL */

.sidebar-overlay { display: none; }

@media (max-width: 1050px) and (min-width: 701px) {
  .main-content { padding-left: 4%; padding-right: 4%; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { width: 180px; height: 180px; }
  .art-circle { width: 160px; height: 160px; }
}

@media (max-width: 700px) {
  .app { display: block; overflow-x: hidden; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    min-width: 280px;
    height: 100dvh;
    z-index: 101;
    flex: 0 0 280px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    overflow-y: auto;
    box-shadow: none;
  }

  .sidebar:hover {
    width: 280px;
    min-width: 280px;
    flex-basis: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,.12);
  }

  .sidebar-header {
    height: 70px;
    flex-basis: 70px;
    min-width: 280px;
    padding: 0 22px;
  }

  .sidebar-header .brand { display: flex; opacity: 1; visibility: visible; }
  .sidebar-hamburger { display: none; }
  .sidebar-close { display: block; }

  .sidebar-content {
    display: block;
    width: 280px;
    min-width: 280px;
    flex: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    overflow: visible;
    padding: 20px 16px;
  }

  .sidebar-bottom {
    display: flex;
    width: 280px;
    min-width: 280px;
    opacity: 1;
    visibility: visible;
    padding: 20px 16px;
  }

  .sidebar-label, .sidebar-divider, .album-list { display: block; }

  .sidebar-create, .sidebar-menu-btn {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 0 9px !important;
    padding: 11px 13px !important;
    justify-content: flex-start !important;
  }

  .nav-text { display: inline !important; }
  .nav-icon { width: 22px !important; min-width: 22px !important; }

  .sidebar-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,.35);
  }

  .main-content {
    width: 100%;
    min-width: 0;
    padding: 0 20px;
  }

  .topbar { height: 65px; }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
  }

  .mobile-brand { display: flex; font-size: 19px; }

  .user-label {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero { min-height: auto; padding: 55px 0 40px; }
  .hero-copy h1 { font-size: 42px; }
  .hero-art { display: none; }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 30px;
  }

  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .toolbar-actions button { flex: 1; }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .memory-info { padding: 10px; }
  .memory-info h3 { font-size: 17px; }
  .memory-actions { padding-top: 8px; flex-wrap: wrap; }

  .settings-card { max-height: 88vh; padding: 30px 22px; }
}

@media (max-width: 420px) {
  .login-card { padding: 28px 22px; }
  .hero-copy h1 { font-size: 36px; }
  .gallery { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .modal-card { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
