:root {
  --primary-color: #F5841F;
  --secondary-color: #2196f3;
  --accent-color: #ff9800;
  --error-color: #f44336;
  --success-color: #4caf50;
  --warning-color: #ffc107;
  --info-color: #2196f3;
  --text-color: #333333;
  --light-text-color: #757575;
  --background-color: #ffffff;
  --light-background-color: #f5f5f5;
  --border-color: #e0e0e0;
  --font-family:
    'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen', 'Ubuntu',
    'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

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

html,
body {
  height: 100%;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--background-color);
  scroll-padding-top: 5rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: var(--font-family);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.3s,
    color 0.3s;
}

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

.btn-primary:hover {
  background-color: #E06B10;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #0c7cd5;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.success-message {
  color: var(--success-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.auth-container {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

.social-btn:hover {
  background-color: var(--light-background-color);
}

.google-btn {
  color: #4285f4;
}

.facebook-btn {
  color: #3b5998;
}

.linkedin-btn {
  color: #0077b5;
}

.wechat-btn {
  color: #7bb32e;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 0.5rem;
  color: var(--light-text-color);
}

.error-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #ffebee;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error-container h1 {
  color: var(--error-color);
  margin-bottom: 1rem;
}

.error-container pre {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.navbar-nav {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* Profile */
.profile-container {
  max-width: 800px;
  margin: 2rem auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info h1 {
  margin-bottom: 0.5rem;
}

.profile-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.profile-tab.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

/* Map */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0.75rem !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 0 !important;
  }

  .navbar > div:first-child .navbar-nav {
    display: none !important;
  }

  .navbar > form {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .container {
    /* Match fixed navbar clearance (see Layout main paddingTop); 3.25rem let content sit under the bar */
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}

/* ─────────── Profile Albums ─────────────────────────────────────────── */
.albums-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.albums-toolbar__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.albums-toolbar__quota {
  font-size: 0.8125rem;
  color: #6b7280;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.album-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.album-card__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  overflow: hidden;
}

.album-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.album-card__body {
  padding: 0.75rem 0.875rem;
}

.album-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card__meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.album-card__actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.album-card:hover .album-card__actions,
.album-card:focus-within .album-card__actions {
  opacity: 1;
}

.album-card__actions button {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.3125rem;
  cursor: pointer;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.album-card__actions button:hover {
  background: #ffffff;
  color: #111827;
}

.album-card__action--danger:hover {
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

/* Visibility badges */
.album-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(17, 24, 39, 0.7);
  color: #ffffff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.album-badge--public {
  background: rgba(16, 185, 129, 0.85);
}

.album-badge--connections {
  background: rgba(59, 130, 246, 0.85);
}

.album-badge--private {
  background: rgba(75, 85, 99, 0.85);
}

/* Empty state */
.album-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.album-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.album-btn--primary {
  background: #3B82F6;
  color: #ffffff;
}

.album-btn--primary:hover:not(:disabled) {
  background: #2563EB;
}

.album-btn--primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.album-btn--secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.album-btn--secondary:hover {
  background: #e5e7eb;
}

.album-btn--ghost {
  background: transparent;
  color: #374151;
}

.album-btn--ghost:hover {
  background: #f3f4f6;
}

/* Modal */
.album-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.album-modal {
  background: #ffffff;
  border-radius: 0.875rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.album-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.album-modal__header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.album-modal__header button {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.album-modal__header button:hover {
  background: #f3f4f6;
  color: #111827;
}

.album-modal__field {
  display: block;
  margin-bottom: 1rem;
}

.album-modal__field > span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.album-modal__field input[type='text'],
.album-modal__field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: #111827;
  background: #ffffff;
}

.album-modal__field input[type='text']:focus,
.album-modal__field textarea:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.album-modal__error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.album-modal__error a {
  color: #b91c1c;
  font-weight: 600;
  text-decoration: underline;
}

.album-vis-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.album-vis-option {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.album-vis-option input[type='radio'] {
  margin-top: 0.125rem;
}

.album-vis-option.is-selected {
  border-color: #3B82F6;
  background: #eff6ff;
}

.album-vis-option.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.album-vis-option__label {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
}

.album-vis-option__hint {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

.album-vis-option__quota {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-style: italic;
}

.album-vis-option__upsell {
  color: #92400e;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.album-vis-option__upsell a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

.album-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Detail / lightbox */
.album-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.album-detail__title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.album-detail__title h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-detail__title .album-badge {
  position: static;
}

.album-detail__desc {
  color: #4b5563;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

.album-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f3f4f6;
}

.album-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.album-photo__delete {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 0.375rem;
  padding: 0.3125rem;
  cursor: pointer;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.album-photo:hover .album-photo__delete {
  opacity: 1;
}

.album-photo__delete:hover {
  color: #dc2626;
}

.album-lightbox {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
}

.album-lightbox img {
  max-width: 100%;
  max-height: 85vh;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.album-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.album-lightbox__caption {
  color: #ffffff;
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
}
