/**
 * Profile & Community Styles for Materyaal Ders Oyunları
 * Modern, bright educational theme with rounded cards, tactile badges, and responsive grids.
 */

/* Profile Header Section */
.profile-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.profile-avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  text-transform: uppercase;
}

.profile-details {
  flex: 1;
  min-width: 260px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.profile-display-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.profile-username-tag {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #ddd6fe;
}

.profile-bio {
  font-size: 1.05rem;
  color: #475569;
  margin-bottom: 1rem;
  line-height: 1.5;
  max-width: 720px;
  word-break: break-word;
}

.profile-badges-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.profile-badge.badge-games {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.profile-badge.badge-interest {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.profile-badge.badge-date {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* User Setup & Profile Modal Styles */
.avatar-color-palette {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.avatar-color-option {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.avatar-color-option:hover {
  transform: scale(1.12);
}

.avatar-color-option.selected {
  border-color: #0f172a;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #ffffff;
}

.checkbox-group-horizontal {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

/* Community Games & Profile Games Grid */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.community-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.community-card-top {
  padding: 1.25rem 1.25rem 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.community-type-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #1e3a8a;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.community-card-body {
  padding: 0 1.25rem 1rem 1.25rem;
  flex: 1;
}

.community-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.community-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.85rem;
}

.community-author-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  margin-top: auto;
}

.community-author-box:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.author-mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.author-meta-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.author-display-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.author-username-slug {
  font-size: 0.78rem;
  color: #7c3aed;
  font-weight: 600;
}

.community-card-footer {
  padding: 0.85rem 1.25rem;
  background: #fafaf9;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-stats-text {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grade Filter Pills */
.grade-pill-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.grade-pill-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grade-pill-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.grade-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Community Specific Enhancements */
.community-hero-banner {
  position: relative;
  overflow: hidden;
}
.community-hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.community-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.community-hero-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.26) !important;
}

.community-quick-tab {
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 0.45rem 1rem !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
}
.community-quick-tab:hover {
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}
.community-quick-tab.active {
  background: #1e3a8a !important;
  color: #ffffff !important;
  border-color: #1e3a8a !important;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25) !important;
}

/* User's own game highlight */
.community-card.is-owner-game {
  border: 1.5px solid #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}
.community-card.is-owner-game:hover {
  border-color: #d97706;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.22);
}

.badge-owner-tag {
  animation: ownerPulse 2s infinite ease-in-out;
}
@keyframes ownerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.02); }
}

/* Featured Teacher Cards */
.featured-teacher-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.featured-teacher-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.12) !important;
  border-color: #cbd5e1 !important;
}

.featured-teacher-card .teacher-card-avatar-wrap {
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .profile-hero {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  .profile-name-row, .profile-badges-row {
    justify-content: center;
  }
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .community-hero-chips {
    flex-direction: column;
    align-items: flex-start;
  }
}

