/* ===== APP STYLES (Familienbereich) ===== */

/* Login View */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdf6e8 0%, #fcebd8 25%, #fde2d7 50%, #f8eee4 75%, #fdf8f0 100%);
  background-size: 300% 300%;
  animation: gradientFlow 12s ease infinite;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Login bokeh */
.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-bokeh {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: bokehFloat ease-in-out infinite;
}
.lb1 { width: 250px; height: 250px; top: -5%; right: 10%; background: radial-gradient(circle, var(--gold-light), transparent 70%); animation-duration: 16s; }
.lb2 { width: 200px; height: 200px; bottom: 5%; left: -5%; background: radial-gradient(circle, var(--peach), transparent 70%); animation-duration: 20s; animation-delay: 3s; }
.lb3 { width: 150px; height: 150px; top: 40%; left: 20%; background: radial-gradient(circle, var(--lavender), transparent 70%); animation-duration: 18s; animation-delay: 5s; }

@keyframes bokehFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 15px) scale(0.9); }
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-container { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.login-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 16px rgba(201,168,76,0.08);
  border: 1px solid rgba(255,255,255,0.6);
  animation: loginCardIn 0.6s ease;
}
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-illustration {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.login-logo { display: block; text-align: center; margin-bottom: 16px; }
.login-logo .family-name { font-size: 2rem; }
.login-logo .family-subtitle { font-size: 0.85rem; color: var(--gold); font-weight: 500; letter-spacing: 3px; text-transform: uppercase; }

.login-welcome {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; }
.form-group label i { color: var(--gold); font-size: 0.8rem; }
.form-group input, .form-group textarea {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.3s ease;
  background: rgba(250,250,248,0.8);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.1);
}
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 48px; }
.password-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray); cursor: pointer; padding: 4px; transition: color 0.3s ease; }
.password-toggle:hover { color: var(--gold); }
.form-error { background: #fef2f2; color: #dc2626; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid #fecaca; }
.form-success { background: #f0fdf4; color: #16a34a; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid #bbf7d0; }
.btn-full { width: 100%; justify-content: center; }
.login-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  color: var(--gray);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}
.login-back:hover { color: var(--gold); gap: 10px; }

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201,168,76,0.1);
}
.app-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; max-width: 1400px; margin: 0 auto; }
.logo-sm .family-name { font-size: 1.25rem; letter-spacing: 2px; }
.app-nav { display: flex; gap: 4px; }
.app-nav-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-nav-btn:hover { color: var(--text); background: var(--light); }
.app-nav-btn.active {
  color: var(--gold);
  background: linear-gradient(135deg, rgba(201,168,76,0.1), rgba(201,168,76,0.04));
}
.app-user { display: flex; align-items: center; gap: 12px; }
.user-badge {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  padding: 4px 12px;
  background: var(--light);
  border-radius: 20px;
}

/* Views */
.app-view { padding-top: 80px; min-height: 100vh; background: var(--off-white); }
.view { padding: 32px 0; }
.view-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.view-header h2 { font-size: 1.5rem; flex: 1; display: flex; align-items: center; gap: 10px; }
.view-header h2 i { color: var(--gold); font-size: 1.2rem; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.container-sm { max-width: 600px; }

/* Albums Grid */
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.album-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(229,226,219,0.6);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.album-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 16px rgba(201,168,76,0.08);
  border-color: transparent;
}
.album-cover { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--light), var(--border)); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.album-card:hover .album-cover img { transform: scale(1.05); }
.album-cover i { font-size: 3rem; color: var(--gray); opacity: 0.4; }
.album-info { padding: 18px 22px; }
.album-info h3 { font-size: 1.1rem; margin-bottom: 6px; }
.album-meta { display: flex; align-items: center; gap: 12px; color: var(--gray); font-size: 0.85rem; }

/* Photos Grid */
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.photo-card {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--light);
  transition: all 0.3s ease;
}
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.photo-card:hover img { transform: scale(1.06); }
.photo-card .photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 60%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.photo-card:hover .photo-overlay { opacity: 1; }
.photo-overlay span { color: white; font-size: 0.85rem; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Empty State */
.empty-state { text-align: center; padding: 80px 24px; color: var(--gray); }
.empty-emoji-large { font-size: 4rem; margin-bottom: 16px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.loading { text-align: center; padding: 60px; color: var(--gray); }
.loading i { margin-right: 8px; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 80px rgba(0,0,0,0.12);
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-sm { max-width: 440px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--gold); }
.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray);
  cursor: pointer;
  padding: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.modal-close:hover { background: var(--light); color: var(--text); }
.modal-body { padding: 28px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 28px; border-top: 1px solid var(--border); }

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(201,168,76,0.3);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(201,168,76,0.02), transparent);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(201,168,76,0.02));
  transform: scale(1.01);
}
.drop-zone-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(201,168,76,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: all 0.3s ease;
}
.drop-zone:hover .drop-zone-icon { transform: translateY(-4px); }
.drop-zone-icon i { font-size: 2rem; color: var(--gold); }
.drop-zone p { font-weight: 500; margin-bottom: 4px; }
.drop-zone span { font-size: 0.85rem; color: var(--gray); }

/* Upload Preview */
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 16px; }
.upload-preview .preview-item { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove-preview {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.preview-item .remove-preview:hover { background: #ef4444; transform: scale(1.1); }

/* Upload Progress */
.upload-progress { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.progress-bar { flex: 1; height: 6px; background: var(--light); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 3px; transition: width 0.3s ease; width: 0%; }
#progressText { font-size: 0.85rem; font-weight: 600; color: var(--gold); min-width: 40px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.92); backdrop-filter: blur(8px); }
.lightbox-content { position: relative; z-index: 1; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-content img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-caption { color: white; text-align: center; margin-top: 12px; font-size: 0.95rem; opacity: 0.8; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-toolbar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 16px; }
.lightbox-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox-btn:hover { background: rgba(255,255,255,0.2); }
.lightbox-delete:hover { background: rgba(239,68,68,0.7); }
.lightbox-counter { color: rgba(255,255,255,0.6); font-size: 0.85rem; }

/* Settings */
.settings-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  border: 1px solid rgba(229,226,219,0.6);
  box-shadow: var(--shadow);
}
.settings-card h3 { font-size: 1.2rem; margin-bottom: 24px; }
.settings-card .form-group { margin-bottom: 16px; }
.settings-card .btn { margin-top: 8px; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  backdrop-filter: blur(8px);
}
.toast-success { background: linear-gradient(135deg, #16a34a, #22c55e); color: white; }
.toast-error { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.toast-info { background: linear-gradient(135deg, var(--dark), #374151); color: white; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-header-inner { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .app-nav-btn span { display: none; }
  .app-user .user-badge { display: none; }
  .login-card { padding: 36px 28px; }
  .login-illustration { font-size: 2.5rem; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .albums-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .photos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .modal { margin: 16px; max-height: 95vh; }
  .login-bg .login-bokeh { opacity: 0.06; }
}

@media (max-width: 480px) {
  .photos-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .photo-card { border-radius: 6px; }
  .albums-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
