/* Profile page styles */
.profile-header {
  background: linear-gradient(135deg, #74ac00 0%, #5d8a00 100%);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 25px;
  color: white;
  display: flex;
  align-items: center;
  gap: 25px;
  box-shadow: 0 4px 15px rgba(116, 172, 0, 0.3);
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 25px;
  flex: 1;
}

.recent-photos-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0;
  width: 400px;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: -30px;
  margin-left: 20px;
}

.recent-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s, opacity 0.2s;
}

.recent-photo:hover {
  transform: scale(1.15);
  z-index: 1;
  opacity: 0.9;
}

.recent-photo-link {
  display: block;
  line-height: 0;
  overflow: hidden;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.profile-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.profile-login {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 10px;
}

.profile-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

a.stat-card {
  text-decoration: none;
  color: inherit;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-value.green { color: #74ac00; }
.stat-value.blue { color: #74ac00; }
.stat-value.orange { color: #74ac00; }
.stat-value.red { color: #e74c3c; }
.stat-value.purple { color: #74ac00; }
.stat-value.teal { color: #74ac00; }

.stat-label {
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  text-align: center;
}

.pie-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-label {
  color: #666;
}

.legend-value {
  font-weight: 600;
  color: #333;
  margin-left: auto;
}

.taxon-chart-container {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: center;
  height: 150px;
  padding: 10px 0;
}

.taxon-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  color: inherit;
}

.taxon-bar-col:hover {
  opacity: 0.8;
}

a.taxon-bar-col:hover {
  color: inherit;
}

.taxon-bar-wrapper {
  width: 36px;
  background: #f0f0f0;
  border-radius: 4px 4px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.taxon-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease-out;
  min-height: 4px;
}

.taxon-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-align: center;
}

.taxon-bar-emoji {
  font-size: 18px;
}

.taxon-bar-name {
  font-size: 9px;
  color: #888;
  text-align: center;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  margin-bottom: 25px;
}

.search-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

.search-row .input-wrapper {
  position: relative;
  width: 300px;
}

.search-row .input-wrapper input {
  width: 100%;
}

.profile-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.profile-link:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.map-card {
  flex: 1;
  min-width: 0;
}

.world-grid-map {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 0;
  border-radius: 6px;
  background: #1a1a1a;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  width: 100%;
}

.world-grid-map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.grid-cell {
  aspect-ratio: 1;
  position: relative;
  z-index: 1;
  background: transparent;
}

.grid-cell.observed {
  background: rgba(116, 172, 0, 0.8);
}

.map-subtitle {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.countries-card {
  flex: 1;
  min-width: 0;
}

.countries-subtitle {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.countries-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.2s;
}

.country-item:hover {
  background: #e8e8e8;
  transform: translateY(-1px);
}

.country-flag {
  font-size: 1.2rem;
}

.country-name {
  font-weight: 500;
  color: #333;
}

.country-count {
  color: #666;
  font-size: 0.8rem;
}

.countries-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.countries-progress {
  font-size: 0.85rem;
  color: #888;
  margin-top: 10px;
}

/* Calendar styles */
.calendar-card {
  margin-bottom: 20px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.calendar-header .chart-title {
  margin-bottom: 0;
}

.calendar-year-select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

.calendar-streak-info {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: #666;
}

.calendar-streak-info strong {
  color: #74ac00;
}

.calendar-container {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.calendar-weekdays {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: #888;
  padding-top: 20px;
}

.calendar-weekday {
  height: 12px;
  display: flex;
  align-items: center;
}

.calendar-wrapper {
  overflow-x: auto;
}

.calendar-months {
  display: flex;
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
  height: 16px;
}

.calendar-month {
  text-align: left;
}

.calendar-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 2px;
}

.calendar-day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #ebedf0;
}

.calendar-day[data-level="1"] { background: #c6e48b; }
.calendar-day[data-level="2"] { background: #7bc96f; }
.calendar-day[data-level="3"] { background: #40c463; }
.calendar-day[data-level="4"] { background: #30d158; }

.calendar-day:hover {
  outline: 1px solid #666;
}

.calendar-day.today {
  outline: 2px solid #74ac00;
  outline-offset: -1px;
}

@media (max-width: 768px) {
  .map-card {
    max-width: 100%;
  }

  .countries-card {
    max-width: 100%;
  }

  .calendar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .calendar-year-select {
    margin-left: 0;
  }

  .calendar-streak-info {
    flex-direction: column;
    gap: 5px;
  }

  .calendar-grid {
    grid-template-rows: repeat(7, 10px);
    grid-auto-columns: 10px;
  }

  .calendar-day {
    width: 10px;
    height: 10px;
  }

  .calendar-weekday {
    height: 10px;
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.empty-state-text {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 25px 20px;
  }

  .profile-left {
    flex-direction: column;
  }

  .profile-meta {
    justify-content: center;
    flex-wrap: wrap;
  }

  .profile-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .recent-photos-grid {
    width: calc(100% + 40px);
    max-width: none;
    height: 80px;
    margin: 15px -20px -25px -20px;
    border-radius: 0 0 16px 16px;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: 1fr;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .pie-chart-container {
    flex-direction: column;
    gap: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-row .input-wrapper {
    width: 100%;
  }

  .search-row {
    flex-direction: column;
    gap: 10px;
  }

  .search-row button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 60px;
  }

  .back-button {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    top: 10px !important;
    left: 10px !important;
  }

  .profile-header {
    padding: 20px 15px;
  }

  .profile-avatar,
  .profile-avatar-placeholder {
    width: 70px;
    height: 70px;
    font-size: 36px;
  }

  .profile-name {
    font-size: 1.3rem;
  }

  .profile-login {
    font-size: 0.95rem;
  }

  .profile-meta {
    font-size: 0.8rem;
    gap: 12px;
  }

  .profile-links {
    gap: 8px;
  }

  .profile-link {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .recent-photos-grid {
    height: 60px;
    margin: 15px -15px -20px -15px;
    width: calc(100% + 30px);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 15px 10px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .chart-card {
    padding: 15px;
  }

  .chart-title {
    font-size: 1rem;
  }

  .taxon-chart-container {
    height: 120px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .taxon-bar-wrapper {
    width: 24px;
  }

  .taxon-bar-emoji {
    font-size: 12px;
  }

  .taxon-bar-value {
    font-size: 8px;
  }

  .taxon-bar-name {
    display: none;
  }

  .pie-chart {
    width: 150px;
    height: 150px;
  }

  .legend-item {
    font-size: 0.8rem;
  }

  .map-card {
    max-width: 100%;
  }

  .search-card {
    padding: 15px;
  }
}

/* Hide default pipeback widget */
#pipeback-widget-container,
.pipeback-launcher-frame {
  display: none !important;
}

/* Custom feedback button */
.feedback-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #74ac00;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: all 0.3s;
}

.feedback-button:hover {
  background: #5d8a00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
