/* DoodleCraft — Gallery & Profile Styles */

/* ── Gallery Page ── */
.gallery-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.gallery-header h2 {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tabs */
.gallery-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 4px;
}

.gallery-tab {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.gallery-tab:hover { color: var(--text-primary); }
.gallery-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.gallery-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  group: true;
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.gallery-card-image {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.gallery-card-image img,
.gallery-card-image canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
  gap: var(--space-sm);
}
.gallery-card:hover .gallery-card-overlay { opacity: 1; }

.gallery-card-overlay .overlay-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.9);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}
.gallery-card-overlay .overlay-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.gallery-card-info {
  padding: var(--space-md);
}
.gallery-card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}
.lightbox.active { display: flex; }

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.3s var(--ease-out);
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* ── Profile Page ── */
.profile-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.profile-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

body.dark-mode .profile-card::before {
  background: linear-gradient(135deg, #2a1a2e, #1a1a3e);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto var(--space-md);
  position: relative;
  z-index: 1;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

#profile-name-input {
  text-align: center;
  max-width: 300px;
  margin: 0 auto var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.2rem;
  border: 1.5px dashed var(--border);
  position: relative;
  z-index: 1;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--primary);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  position: relative;
  z-index: 1;
}

/* ── Empty Gallery ── */
.gallery-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4xl) var(--space-lg);
  text-align: center;
}
.gallery-empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}
.gallery-empty h3 { margin-bottom: var(--space-sm); }
.gallery-empty p { margin-bottom: var(--space-lg); }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap:var(--space-md); }
  .gallery-header { flex-direction: column; align-items: stretch; text-align: center; }
  .profile-stats { gap: var(--space-lg); }
}
