* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f5f7fb;
  color: #1e293b;
  line-height: 1.5;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #e9eef3;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #b9c2d0;
  border-radius: 10px;
}

.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
}
.gallery-header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b, #3b4e6e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}
.gallery-header p {
  color: #5b6e8c;
  font-size: 1rem;
  margin-top: 0.5rem;
}
.header-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5e7a;
}
.header-stats span i {
  margin-right: 6px;
  color: #7c8ea0;
}

/* секция переключения между альбомами */
.album-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}
.album-tab {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 10px 28px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.album-tab i {
  margin-right: 8px;
}
.album-tab.active {
  background: #2c3e66;
  color: white;
  border-color: #2c3e66;
}
.album-tab.private-locked {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: pointer;
}
.album-tab.private-unlocked {
  background: #2c3e66;
  color: white;
}

/* модальное окно ввода пароля */
.password-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}
.password-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}
.password-card {
  background: white;
  border-radius: 32px;
  max-width: 380px;
  width: 90%;
  padding: 2rem 1.8rem;
  text-align: center;
  box-shadow: 0 25px 45px rgba(0,0,0,0.3);
}
.password-card i {
  font-size: 3rem;
  color: #2c3e66;
  margin-bottom: 1rem;
}
.password-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.password-card p {
  color: #5b6e8c;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.password-card input {
  width: 100%;
  padding: 12px 16px;
  margin: 10px 0;
  border: 1px solid #cfdfed;
  border-radius: 60px;
  font-size: 1rem;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.password-card input:focus {
  border-color: #2c3e66;
  box-shadow: 0 0 0 3px rgba(44,62,102,0.2);
}
.password-card button {
  background: #2c3e66;
  color: white;
  border: none;
  width: auto;
  padding: 8px 20px;
  border-radius: 60px;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 12px;
  cursor: pointer;
  transition: 0.2s;
}
.password-card button:hover {
  background: #1e2a4a;
}
.button-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.button-group button {
  margin-top: 0;
}
.close-pw {
  background: transparent !important;
  color: #7e8b9f !important;
  border: 1px solid #e2e8f0 !important;
}
.close-pw:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}
.pw-error {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 12px;
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* тулбар */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  background: white;
  padding: 0.8rem 1.5rem;
  border-radius: 60px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.05);
}
.search-box {
  display: flex;
  align-items: center;
  background: #f1f4f9;
  border-radius: 40px;
  padding: 0.4rem 1rem;
  gap: 8px;
  flex: 1;
  max-width: 320px;
}
.search-box i {
  color: #7e8b9f;
}
.search-box input {
  border: none;
  background: transparent;
  padding: 0.6rem 0;
  width: 100%;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.view-toggle {
  display: flex;
  gap: 10px;
}
.view-toggle button {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #94a3b8;
  transition: 0.2s;
  padding: 6px 10px;
  border-radius: 30px;
}
.view-toggle button.active {
  color: #2c3e66;
  background: #eef2ff;
}
.photo-count {
  font-size: 0.85rem;
  font-weight: 500;
  background: #eef2ff;
  padding: 0.3rem 0.9rem;
  border-radius: 30px;
  color: #2c3e66;
}

/* фотосетка */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.6rem;
  transition: all 0.2s ease;
}
.photo-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.photo-grid.list-view .photo-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}
.photo-grid.list-view .photo-card .img-wrapper {
  width: 140px;
  height: 100px;
  flex-shrink: 0;
}

.photo-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.03), 0 2px 6px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  cursor: pointer;
}
.photo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -12px rgba(0,0,0,0.15);
}
.img-wrapper {
  position: relative;
  overflow: hidden;
  background: #eef2f6;
  aspect-ratio: 4 / 3;
}
.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
  pointer-events: none;
}
.photo-card:hover .img-wrapper img {
  transform: scale(1.03);
}
.photo-info {
  padding: 1rem 1.2rem 1.2rem;
}
.photo-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: #0f172a;
}
.photo-date {
  font-size: 0.7rem;
  color: #6c7a91;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.photo-desc {
  font-size: 0.8rem;
  color: #475569;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* модальное окно фото */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.modal.active {
  display: flex;
}
.modal-content {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 28px;
  overflow: hidden;
  background: #111;
}
.modal-content img {
  max-width: 100%;
  max-height: 85vh;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}
.modal-info {
  margin-top: 20px;
  background: rgba(30,30,40,0.7);
  backdrop-filter: blur(16px);
  border-radius: 60px;
  padding: 0.6rem 1.2rem;
  color: white;
  font-size: 0.9rem;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.close-modal {
  position: absolute;
  top: 24px;
  right: 32px;
  color: white;
  font-size: 32px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  width: 48px;
  height: 48px;
  border-radius: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-modal:hover {
  background: #c2410c;
}
.nav-modal {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 60px;
  cursor: pointer;
}
.nav-modal.prev { left: 20px; }
.nav-modal.next { right: 20px; }
.nav-modal:hover { background: #000000aa; }

.watermark-note {
  text-align: center;
  font-size: 0.7rem;
  margin-top: 2rem;
  color: #94a3b8;
}
footer {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #5e6f8d;
}

@media (max-width: 680px) {
  .gallery-container { padding: 1rem; }
  .toolbar { flex-direction: column; align-items: stretch; border-radius: 28px; }
  .search-box { max-width: 100%; }
  .gallery-header h1 { font-size: 1.9rem; }
  .album-tabs { flex-wrap: wrap; }
}