/* Member dashboard (frontend/dashboard.html) */

/* Dashboard Navigation */
.dashboard-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
}

.nav-left .profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
  cursor: pointer;
}

.nav-left .profile-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-left .avatar.medium {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-chip-name {
  font-weight: 600;
  color: var(--primary-dark);
  max-width: 150px;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-center {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex: 1;
}

.nav-center .nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  color: var(--primary-dark);
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.nav-center .nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary);
}

.nav-center .nav-link.ghost {
  display: none;
}

.nav-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-home-btn {
  display: inline-flex;
}

html[data-theme="dark"] body.dashboard-page {
  background: var(--body-bg);
}

html[data-theme="dark"] .dashboard-page .profile-stats div,
html[data-theme="dark"] .dashboard-page .edit-mode-note,
html[data-theme="dark"] .dashboard-page .avatar-badge {
  background: rgba(151, 181, 220, 0.12);
  color: var(--ink);
}

html[data-theme="dark"] .dashboard-page .dash-title,
html[data-theme="dark"] .dashboard-page .section-subtitle,
html[data-theme="dark"] .dashboard-page .profile-name,
html[data-theme="dark"] .dashboard-page .profile-stats span,
html[data-theme="dark"] .dashboard-page .nav-center .nav-link,
html[data-theme="dark"] .dashboard-page .profile-chip-name {
  color: var(--ink);
}

/* Mobile responsive header */
@media (max-width: 980px) {
  .dashboard-nav {
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 12px 0;
  }
  
  .nav-center {
    display: none;
  }
  
  .nav-center.mobile-visible {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 720px) {
  .profile-picture-tools {
    grid-template-columns: 1fr;
  }

  .profile-picture-preview {
    width: 84px;
    height: 84px;
  }

  .dashboard-nav {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 4px 0;
  }

  .site-header.minimal {
    min-height: auto;
  }
  
  .nav-left .avatar.medium {
    width: 36px;
    height: 36px;
  }
  
  .profile-chip-name {
    max-width: 92px;
    font-size: 12px;
  }

  .nav-left .profile-link {
    gap: 7px;
    padding: 4px;
  }

  .nav-right {
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .dashboard-home-btn {
    display: inline-flex;
    min-height: 29px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .dashboard-main {
    padding: 28px 0 56px !important;
  }

  .dashboard-hero {
    gap: 14px;
    margin-bottom: 24px !important;
  }
  
  .nav-right .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .nav-right .role-badge,
  .nav-right [data-logout] {
    display: none;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-head > button {
    width: 100%;
  }

  .section-head > div {
    width: 100%;
  }
}

body.dashboard-page {
  background: linear-gradient(160deg, #e3f5f7 0%, #ffffff 55%);
}

body.dashboard-page main {
  padding-top: 0;
}

.dashboard-main {
  padding: 60px 0 80px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: center;
  margin-bottom: 40px;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.profile-stats div {
  background: rgba(12, 59, 75, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}

.profile-stats span {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
}

.profile-stats p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.profile-visual {
  position: relative;
}

.avatar-button {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.avatar-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(12, 59, 75, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

.profile-popover {
  position: absolute;
  top: 90px;
  left: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  width: min(280px, 72vw);
  display: none;
  gap: 12px;
  z-index: 20;
}

.profile-popover.show {
  display: grid;
}

.profile-popover-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.profile-name {
  font-weight: 600;
  color: var(--primary-dark);
}

.profile-meta {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-picture-tools {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.profile-picture-preview {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(12, 59, 75, 0.08);
  border: 1px solid rgba(12, 59, 75, 0.08);
}

.profile-picture-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-picture-copy {
  display: grid;
  gap: 8px;
}

.dash-title {
  font-family: "Playfair Display", serif;
  color: var(--primary-dark);
}

.text-shimmer {
  background: linear-gradient(90deg, var(--primary), var(--accent-dark), var(--primary));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  color: transparent;
  animation: textShimmer 4s ease-in-out infinite;
}

.animated-text {
  color: var(--muted);
  font-size: 15px;
}

.word-animate {
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  animation: wordBounce 3s ease-in-out infinite;
}

.word-animate:nth-child(1) {
  animation-delay: 0s;
}

.word-animate:nth-child(3) {
  animation-delay: 0.6s;
}

.word-animate:nth-child(5) {
  animation-delay: 1.2s;
}

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

@keyframes wordBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.content-stack {
  display: grid;
  gap: 28px;
}

.content-stack.compact {
  gap: 20px;
}

.manage-grid {
  display: grid;
  gap: 24px;
}

.compact-feed {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-subtitle {
  margin-bottom: 14px;
  color: var(--primary-dark);
}

.edit-mode-note {
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(26, 111, 121, 0.08);
  color: var(--primary-dark);
  font-size: 13px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.about-card {
  position: relative;
}

.about-highlight {
  background:
    radial-gradient(circle at top right, rgba(127, 216, 166, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(11, 61, 145, 0.96), rgba(6, 43, 103, 0.94));
  color: #ffffff;
}

.about-highlight h3,
.about-highlight p,
.about-highlight .eyebrow {
  color: #ffffff;
}

/* Scrollable Content Sections */
.card-grid {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.dashboard-page .compact-form-grid {
  max-height: none;
  overflow: visible;
  padding-right: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  justify-content: start;
}

.card-grid::-webkit-scrollbar {
  width: 8px;
}

.card-grid::-webkit-scrollbar-track {
  background: rgba(6, 34, 45, 0.05);
  border-radius: 10px;
}

.card-grid::-webkit-scrollbar-thumb {
  background: rgba(6, 34, 45, 0.2);
  border-radius: 10px;
  transition: background 0.2s;
}

.card-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 34, 45, 0.4);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-modal[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 28, 56, 0.9);
  backdrop-filter: blur(4px);
  z-index: -1;
}

.lightbox-container {
  position: relative;
  width: 90vw;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightboxFadeIn 0.3s ease-out;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lightbox-nav svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .card-grid {
    max-height: 500px;
  }

  .lightbox-container {
    width: 95vw;
    max-height: 85vh;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-nav svg {
    width: 20px;
    height: 20px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 720px) {
  .profile-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-header .avatar {
    margin: 0 auto;
  }

  .profile-popover {
    left: 50%;
    transform: translateX(-50%);
  }

  .dashboard-hero {
    text-align: center;
  }

  .dashboard-page .section {
    padding: 56px 0;
  }
}
