*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #fff; color: #202124; -webkit-font-smoothing: antialiased;
}
.muted { color: #5f6368; }
.err { color: #d93025; margin: 0; font-size: 14px; }
.no-scroll { overflow: hidden; }
.spacer { flex: 1; }

.msi {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; font-feature-settings: "liga"; flex: none;
}
.msi.big { font-size: 64px; color: #bdc1c6; }

/* ─── Login ─── */
.login-body { display: grid; place-items: center; min-height: 100vh; background: #f8f9fa; }
.login-card {
  width: min(360px, 92vw); background: #fff; padding: 36px 30px;
  border: 1px solid #dadce0; border-radius: 14px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 0; font-size: 24px; font-weight: 500; }
.login-card p { margin: 0; font-size: 14px; }
.login-card input, .login-card button { font-size: 15px; padding: 12px 14px; border-radius: 8px; }
.login-card input { border: 1px solid #dadce0; }
.login-card input:focus { outline: 2px solid #1a73e8; outline-offset: 1px; border-color: transparent; }
.login-card button { border: 0; background: #1a73e8; color: #fff; cursor: pointer; font-weight: 500; }
.login-card button:hover { background: #1765cc; }
.login-card button:disabled { opacity: .6; cursor: default; }

/* ─── Butoane ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border: 1px solid #dadce0; background: #fff;
  border-radius: 999px; cursor: pointer; font-size: 14px; font-family: inherit; color: #202124;
}
.btn .msi { font-size: 20px; }
.btn:hover { background: #f1f3f4; }
.btn.primary { background: #1a73e8; border-color: #1a73e8; color: #fff; font-weight: 500; }
.btn.primary:hover { background: #1765cc; }
.btn.ghost { border-color: transparent; background: transparent; color: #1a73e8; font-weight: 500; }
.btn.ghost:hover { background: #e8f0fe; }
.btn.ghost.danger { color: #d93025; }
.btn.ghost.danger:hover { background: #fce8e6; }

.icon-btn2 {
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; color: #5f6368; display: grid; place-items: center; flex: none;
}
.icon-btn2:hover { background: #f1f3f4; }
.icon-btn2 .msi { font-size: 22px; }

/* ─── Lockup ─── */
.lockup { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; color: #5f6368; font-weight: 400; }
.pw {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  background:
    conic-gradient(from 0deg, #4285F4 0 90deg, #EA4335 90deg 180deg, #FBBC04 180deg 270deg, #34A853 270deg 360deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 5px, #000 5.5px);
  mask: radial-gradient(circle at 50% 50%, transparent 5px, #000 5.5px);
}

/* ─── Layout ─── */
.app { display: flex; min-height: 100vh; }
.side {
  width: 256px; flex: none; background: #fff;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding-bottom: 8px;
}
.side-top { display: flex; align-items: center; gap: 8px; padding: 12px 8px 16px 12px; }
.side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side-link {
  display: flex; align-items: center; gap: 20px;
  height: 48px; padding: 0 24px; border-radius: 0 100px 100px 0;
  text-decoration: none; color: #3c4043; font-size: 14px; font-weight: 500;
}
.side-link .msi { font-size: 22px; color: #5f6368; }
.side-link:hover { background: #f1f3f4; }
.side-link.active { background: #e8f0fe; color: #1967d2; }
.side-link.active .msi { color: #1967d2; }
.side-storage { padding: 12px 24px 8px; border-top: 1px solid #f1f3f4; font-size: 13px; color: #5f6368; }
.storage-row { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.storage-row .msi { font-size: 22px; }
.storage-bar { height: 4px; border-radius: 999px; background: #e8eaed; overflow: hidden; }
.storage-fill { height: 100%; width: 4%; background: #1a73e8; }
.storage-text { margin-top: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }

/* ─── Topbar ─── */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; background: #fff;
}
.search {
  display: flex; align-items: center; gap: 12px;
  background: #f1f3f4; border-radius: 100px; padding: 0 16px;
  height: 48px; flex: 1; max-width: 720px; margin-left: 8px;
}
.search:focus-within { background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.15); }
.search .search-ic { color: #5f6368; font-size: 22px; }
.search input {
  flex: 1; border: 0; background: transparent; outline: 0; min-width: 0;
  font-size: 15px; font-family: Roboto, sans-serif; color: #202124;
}
.search-clear { border: 0; background: transparent; color: #5f6368; cursor: pointer; display: grid; place-items: center; }

.acct { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: #1a73e8; color: #fff; font-size: 15px; font-weight: 500;
}
.menu2 {
  position: absolute; right: 0; top: 46px; z-index: 30;
  background: #fff; border: 1px solid #dadce0; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18); padding: 6px; min-width: 180px;
}
.menu2 .menu-item { display: flex; align-items: center; gap: 12px; }
.menu2 .menu-item .msi { font-size: 20px; color: #5f6368; }
.only-mobile { display: none; }

/* ─── Bara de selecție ─── */
.sel-bar {
  position: sticky; top: 0; z-index: 22; height: 64px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; background: #fff; box-shadow: 0 1px 0 #e8eaed;
}
.sel-bar #selCount { font-size: 18px; font-weight: 400; margin-left: 4px; }
.sel-word { color: #5f6368; font-size: 14px; margin-left: 6px; }

/* ─── Vederi ─── */
.view { flex: 1; }
.section-head { display: flex; align-items: center; gap: 10px; max-width: 1720px; margin: 0 auto; padding: 20px 24px 4px; }
.section-head h1 { font-size: 22px; font-weight: 400; margin: 0; }
.album-head { flex-wrap: wrap; }
.album-head h1 { font-size: 20px; }

/* ─── Grilă justified ─── */
.j-scroll { max-width: 1720px; margin: 0 auto; padding: 6px 12px 48px; overflow-x: hidden; }
.j-day { margin-bottom: 24px; }
.j-dayhead { display: flex; align-items: center; gap: 10px; margin: 12px 4px 10px; min-height: 24px; }
.j-dayhead .daylabel { font-size: 14px; font-weight: 500; color: #202124; }
.daychk {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5f6368;
  cursor: pointer; flex: none; position: relative; opacity: 0; transition: opacity .1s;
}
.daychk::after {
  content: "check"; font-family: "Material Symbols Outlined"; font-size: 16px; color: #fff;
  position: absolute; inset: -2px; display: grid; place-items: center; opacity: 0;
}
.j-dayhead:hover .daychk, body.selecting .daychk { opacity: 1; }
.daychk.on { background: #1a73e8; border-color: #1a73e8; opacity: 1; }
.daychk.on::after { opacity: 1; }

.j-row { display: flex; gap: 4px; margin-bottom: 4px; }
.j-tile {
  position: relative; flex: 0 0 auto; padding: 0; border: 0; margin: 0;
  background: #eef0f2; cursor: pointer; overflow: hidden;
}
.j-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .12s ease, border-radius .12s ease; }
.j-tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,0) 42%);
}
.j-tile:hover::before { opacity: 1; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.chk {
  position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: transparent; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  opacity: 0; transition: opacity .1s; cursor: pointer;
}
.chk::after {
  content: "check"; font-family: "Material Symbols Outlined"; font-size: 15px; color: #fff;
  position: absolute; inset: -2px; display: grid; place-items: center; opacity: 0;
}
.j-tile:hover .chk { opacity: 1; }
body.selecting .chk { opacity: 1; }
@media (hover: none) { .chk { opacity: .9; } }
.j-tile.sel { background: #fff; }
.j-tile.sel img { transform: scale(.82); border-radius: 12px; }
.j-tile.sel .chk { background: #1a73e8; border-color: #1a73e8; opacity: 1; }
.j-tile.sel .chk::after { opacity: 1; }

.empty { text-align: center; padding: 80px 20px; }
.empty p { margin: 8px 0; }
.empty .msi.big { display: block; margin: 0 auto 8px; }

/* ─── Albume ─── */
.albums-grid {
  max-width: 1720px; margin: 0 auto; padding: 12px 24px 28px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px;
}
.album-card { text-decoration: none; color: inherit; }
.album-cover { aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: #f1f3f4; display: grid; place-items: center; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover.empty { font-size: 46px; color: #9aa0a6; }
.album-meta { padding: 12px 4px 0; }
.album-name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-sub { font-size: 13px; margin-top: 2px; }

/* ─── Drop overlay ─── */
.drop-overlay {
  position: fixed; inset: 12px; z-index: 50; border-radius: 16px;
  background: rgba(232,240,254,.92); border: 2px dashed #1a73e8;
  display: grid; place-items: center; text-align: center; color: #1a73e8;
}
.drop-overlay p { font-size: 20px; font-weight: 500; margin: 8px 0 0; }
.drop-overlay .msi.big { color: #1a73e8; }

/* ─── Upload tray ─── */
.upload-tray {
  position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(360px, 92vw);
  background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); overflow: hidden;
}
.upload-tray-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; background: #fff; border-bottom: 1px solid #f1f3f4; font-size: 14px; font-weight: 500; }
.upload-tray ul { list-style: none; margin: 0; padding: 8px 14px; max-height: 240px; overflow: auto; }
.upload-tray li { font-size: 13px; padding: 6px 0; }
.upload-tray li.ok .u-name { color: #188038; }
.upload-tray li.fail .u-name { color: #d93025; }
.u-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; background: #e8eaed; border-radius: 999px; margin-top: 5px; overflow: hidden; }
.fill { height: 100%; width: 0; background: #1a73e8; transition: width .15s linear; }
.upload-tray li.ok .fill { background: #188038; }
.upload-tray li.fail .fill { background: #d93025; }

/* ─── Chooser ─── */
.menu {
  position: fixed; z-index: 46; min-width: 220px; max-width: 280px;
  background: #fff; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,.2); padding: 6px;
}
.menu-title { font-size: 12px; color: #5f6368; padding: 8px 12px 4px; }
.menu-list { max-height: 260px; overflow: auto; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 10px 12px; border-radius: 8px; font-size: 14px;
  font-family: inherit; cursor: pointer; color: #202124;
}
.menu-item .msi { font-size: 20px; color: #5f6368; }
.menu-item:hover { background: #f1f3f4; }
.menu-item.new { color: #1a73e8; border-top: 1px solid #eee; margin-top: 4px; }
.menu-item.new .msi { color: #1a73e8; }
.menu-empty { padding: 10px 12px; font-size: 13px; }

/* ─── Modaluri ─── */
.modal { position: fixed; inset: 0; z-index: 55; background: rgba(32,33,36,.5); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(460px, 100%); background: #fff; border-radius: 16px; padding: 24px; }
.modal-card.wide { width: min(960px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal-card h2 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.modal-card p { margin: 0 0 14px; font-size: 14px; }
.share-row { display: flex; gap: 8px; margin-bottom: 16px; }
.share-row input { flex: 1; padding: 10px 12px; border: 1px solid #dadce0; border-radius: 8px; font-size: 13px; }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; }
.picker-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.picker-head h2 { margin: 0; }
.picker-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px; }
.picker-grid .p-tile { position: relative; aspect-ratio: 1/1; border: 0; padding: 0; background: #eee; cursor: pointer; overflow: hidden; }
.picker-grid .p-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .12s; }
.picker-grid .p-tile .chk { opacity: 1; }
.picker-grid .p-tile.sel img { transform: scale(.82); border-radius: 10px; }
.picker-grid .p-tile.sel .chk { background: #1a73e8; border-color: #1a73e8; }
.picker-grid .p-tile.sel .chk::after { opacity: 1; }
.picker-empty { padding: 30px; grid-column: 1 / -1; }

/* ─── Lightbox ─── */
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; }
.lb-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 64px; z-index: 3;
  display: flex; align-items: center; gap: 4px; padding: 0 8px;
  background: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,0));
}
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; transition: right .2s ease; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; display: block; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff;
  cursor: pointer; display: grid; place-items: center; text-decoration: none; flex: none;
}
.icon-btn .msi { font-size: 24px; }
.icon-btn:hover { background: rgba(255,255,255,.15); }
.icon-btn.dark { color: #5f6368; }
.icon-btn.dark:hover { background: #f1f3f4; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px;
  background: rgba(0,0,0,.35); z-index: 3;
}
.lb-prev { left: 16px; } .lb-next { right: 16px; }
@media (hover: hover) {
  .lb-nav, .lb-strip { opacity: 0; transition: opacity .15s; }
  .lightbox:hover .lb-nav, .lightbox:hover .lb-strip { opacity: 1; }
}
.lb-strip {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 84px;
  display: flex; gap: 4px; align-items: center; padding: 10px 12px;
  overflow-x: auto; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.55));
  scrollbar-width: none;
}
.lb-strip::-webkit-scrollbar { display: none; }
.strip-thumb { flex: none; width: 60px; height: 60px; border: 0; padding: 0; background: #222; cursor: pointer; border-radius: 4px; overflow: hidden; opacity: .6; }
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.strip-thumb.cur { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }
.lightbox.has-info .lb-stage { right: 360px; }
.lb-info {
  position: absolute; top: 0; right: 0; bottom: 0; width: 360px; z-index: 4;
  background: #fff; color: #202124; overflow-y: auto;
}
.lb-info-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 24px; font-size: 16px; font-weight: 500; }
#lbInfoBody { padding: 8px 24px 24px; }
#lbInfoBody .info-date { font-size: 15px; font-weight: 500; }
#lbInfoBody .info-time { font-size: 13px; color: #5f6368; margin-top: 2px; margin-bottom: 18px; }
#lbInfoBody .info-row { display: flex; align-items: flex-start; gap: 16px; padding: 10px 0; font-size: 13px; }
#lbInfoBody .info-row .msi { font-size: 20px; color: #5f6368; }
#lbInfoBody .info-row span { word-break: break-word; }
.lb-caption { display: none; }

/* ─── Toast ─── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: #202124; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ─── Mobil ─── */
@media (max-width: 900px) {
  .side {
    position: fixed; left: 0; top: 0; z-index: 40; height: 100vh; width: 280px;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25);
  }
  .side.open { transform: none; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 0 8px; gap: 4px; }
  .search { margin-left: 4px; }
  .lightbox.has-info .lb-stage { right: 0; }
  .lb-info { width: 100%; }
}
@media (max-width: 520px) {
  .search { max-width: none; }
  .sel-word { display: none; }
  .j-scroll { padding: 4px 6px 48px; }
}
