/* ============================================================================
   PLIK: assets/css/components.css
   UI Components - REDESIGN
   Ultra-minimal, flow-inspired components
   ============================================================================ */

/* ========================================================================
   ROUTE CARDS - Minimal with gradient accent
   ======================================================================== */

.route-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.route-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cyan); /* Default, override per route */
  opacity: 0.6;
}

.route-card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.route-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-light);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  color: var(--color-text);
}

.route-card-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 16px;
}

.route-card-meta i,
.route-card-meta svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.2;
}

/* Difficulty badge */
.difficulty-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: var(--font-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.difficulty-easy { background: var(--gradient-easy); }
.difficulty-medium { background: var(--gradient-medium); }
.difficulty-hard { background: var(--gradient-hard); }
.difficulty-expert { background: var(--gradient-expert); }

/* Top route star */
.top-route-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #fbbf24;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-route-badge i,
.top-route-badge svg {
  width: 12px;
  height: 12px;
  color: #f59e0b;
  fill: #fbbf24;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-input-wrapper input {
  padding-left: 40px;
}
/* ========================================================================
   BUTTONS - Minimal grayscale
   ======================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  border: 1px solid transparent;
}

/* Primary - Black */
.btn-primary {
  background: var(--color-primary);
  color: white !important; /* ✅ Force white text */
  border: 1px solid var(--color-primary);
}

.btn-primary:hover {
  background: #000000;
  color: white !important; /* ✅ Keep white on hover */
  border-color: #000000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--color-border);
  border-color: var(--color-border);
  color: var(--color-text-light) !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* SVG w buttonie też musi być białe */
.btn-primary svg {
  color: white;
  stroke: white;
}

/* Secondary - White with border */
.btn-secondary {
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-background-light);
  border-color: var(--color-border-dark);
}

/* Outline - Transparent with border */
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background: white;
  border-color: var(--color-border-dark);
}

/* Accent - Tylko dla BARDZO ważnych akcji */
.btn-accent {
  background: white;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: var(--font-medium);
}

.btn-accent:hover {
  background: var(--color-primary);
  color: white;
}

/* Warning/Edit - Subtelny żółty tylko jako border */
.btn-warning {
  background: white;
  border: 1px solid #fbbf24;
  color: #92400e;
}

.btn-warning:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

/* Success - Subtelny zielony */
.btn-success {
  background: white;
  border: 1px solid #34d399;
  color: #065f46;
}

.btn-success:hover {
  background: #ecfdf5;
  border-color: #10b981;
}

/* Download - Subtelny niebieski */
.btn-download {
  background: white;
  border: 1px solid #60a5fa;
  color: #1e40af;
}

.btn-download:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

/* Block */
.btn-block {
  width: 100%;
}

/* Small */
.btn-sm {
  padding: 6px 14px;
  font-size: var(--text-xs);
}

/* Large */
.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-base);
}

.btn i,
.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover,
.btn.disabled:hover {
  transform: none;
}
/* ========================================================================
   ACHIEVEMENT CARDS - With progress
   ======================================================================== */

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.achievement-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.achievement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
}

.achievement-card.earned::before {
  background: var(--gradient-cyan); /* Override per achievement */
}

.achievement-card.earned:hover {
  border-color: var(--color-border);
  cursor: pointer;
}

.achievement-card:not(.earned) {
  opacity: 0.5;
}

.achievement-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  stroke-width: 1.2;
}

.achievement-name {
  font-size: 11px;
  font-weight: var(--font-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--color-text);
}

.achievement-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 8px;
  background: #d1fae5;
  color: #047857;
  font-weight: var(--font-medium);
}

.achievement-progress {
  font-size: 10px;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
}

/* ========================================================================
   LIBRARY ITEMS - Compact
   ======================================================================== */

.library-category {
  margin-bottom: 24px;
}

.library-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.library-category-title {
  font-size: 12px;
  font-weight: var(--font-light);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-category-title i,
.library-category-title svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.2;
}

.library-category-count {
  font-size: 10px;
  color: var(--color-text-light);
}

.library-item {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.library-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cyan); /* Override per item */
}

.library-item:hover {
  border-color: var(--color-border);
}

.library-item-name {
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  color: var(--color-text);
  margin-bottom: 4px;
}

.library-item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

/* ========================================================================
   FORMS - Minimal
   ======================================================================== */

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  transition: all var(--transition);
  background: white;
  color: var(--color-text); /* ✅ DODAJ */
  line-height: 1.4; /* ✅ DODAJ */
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05); /* ✅ DODAJ subtle focus */
}

.form-input::placeholder {
  color: var(--color-text-light); /* ✅ POPRAW - było tertiary */
}

/* Textarea specific */
textarea.form-input {
  resize: vertical;
  min-height: 80px;
  font-family: inherit; /* ✅ DODAJ */
}

/* Select specific */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ========================================================================
   STATS CARDS - Minimal
   ======================================================================== */

.stat-card {
  background: rgba(245, 245, 247, 0.5);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.stat-card-icon {
  width: 16px;
  height: 16px;
  margin: 0 auto 8px;
  stroke-width: 1.2;
}

.stat-card-value {
  font-size: 20px;
  font-weight: var(--font-light);
  color: var(--color-text);
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

/* ========================================================================
   RATING STARS
   ======================================================================== */

.rating-stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating-stars i,
.rating-stars svg {
  width: 12px;
  height: 12px;
}

.rating-stars .star-filled {
  color: #fbbf24;
  fill: #fbbf24;
}

.rating-stars .star-empty {
  color: #e5e7eb;
  fill: #e5e7eb;
}

.rating-count {
  font-size: 10px;
  color: var(--color-text-light);
  margin-left: 4px;
}

/* ========================================================================
   DIVIDERS
   ======================================================================== */

.divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 16px 0;
}

/* Gradient divider */
.divider-gradient {
  height: 1px;
  background: var(--gradient-cyan);
  opacity: 0.3;
  margin: 16px 0;
  border-radius: 1px;
}

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--color-text-tertiary);
  stroke-width: 1;
}

.empty-state-title {
  font-size: var(--text-sm);
  font-weight: var(--font-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

/* ========================================================================
   MODAL - Dodaj do components.css
   ======================================================================== */

.modal {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid var(--color-border);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white; /* ✅ */
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: white; /* ✅ */
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: white; /* ✅ */
}

/* ✅ Form inputs w modalu - max-width */
.modal-body .form-input {
  max-width: 100%; /* Zapobiega overflow */
}

/* ============================================================================
   MEDALS - Challenge details panel
   ============================================================================ */

.medals {
  margin-left: 10px;
}

.medal {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 16px;
  position: relative;
  padding-bottom: 20px;
}

.medal::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: #d1d5db;
}

.medal:last-child::before {
  display: none;
}

.medal .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  z-index: 1;
  position: relative;
}

.medal .content {
  font-size: 13px;
}

.medal .name {
  font-weight: 600;
  color: var(--color-text);
}

.medal .range {
  font-size: 11px;
  color: #6b7280;
  margin: 2px 0;
}

.medal .price {
  font-size: 11px;
  font-weight: 500;
}

/* ============================================================================
   CHALLENGE DETAILS PANEL
   ============================================================================ */

.challenge-details-content {

  padding-bottom: 24px;
}

.challenge-stats-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.challenge-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Loading */
.challenge-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.challenge-loading svg {
  display: inline-block;
  margin-bottom: 12px;
}

.challenge-loading div {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Hero */
.challenge-hero {
  padding: 24px;
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
}

.challenge-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.challenge-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.02em;
  margin: 0 0 8px 0;
}

.challenge-group {
  font-size: 12px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress Section */
.challenge-progress-section {
  padding: 20px;
  background: linear-gradient(to bottom, rgba(16, 185, 129, 0.05), transparent);
  border-bottom: 1px solid var(--color-border-light);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-value {
  font-size: 24px;
  font-weight: 300;
  color: #10b981;
}

.progress-bar-wrapper {
  height: 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-easy);
  transition: width 0.5s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
}
.challenge-stats-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.challenge-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 4 kolumny gdy jest czas */
.challenge-stats-grid[data-has-time="true"] {
  grid-template-columns: repeat(4, 1fr);
}

/* Stat card override dla wyzwań */
.challenge-stats-section .stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 12px;
}
/* Description */
.challenge-description {
  padding: 20px;
}

.challenge-description p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0;
}

/* Routes Preview Section */
.challenge-routes-section {
  padding: 0 20px 20px;
}

.section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 12px 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.routes-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-preview-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.route-preview-card:hover {
  transform: translateX(4px);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.route-preview-card.completed {
  opacity: 0.7;
  background: rgba(16, 185, 129, 0.05);
}

.route-preview-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-light);
  flex-shrink: 0;
}

.route-number.completed {
  background: #10b981;
  color: white;
}

.route-info {
  flex: 1;
  min-width: 0;
}

.route-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-stats {
  font-size: 11px;
  color: var(--color-text-muted);
}

.route-chevron {
  color: var(--color-text-light);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.route-preview-card:hover .route-chevron {
  transform: translateX(2px);
  color: var(--color-primary);
}

/* Social Proof Section */
.challenge-social-section {
  padding: 0 20px 20px;
}

.social-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ranking-btn {
  padding: 4px 8px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ranking-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.social-stats {
  background: rgba(245, 245, 247, 0.5);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.social-stat .stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
}

.social-stat .stat-value.completion {
  color: #10b981;
}

.social-stat .stat-value.rating {
  color: #fbbf24;
}

.social-stat .stat-label {
  font-size: 10px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

/* Medals Section */
.challenge-medals-section {
  padding: 0 20px 20px;
}

.medals {
  margin-left: 10px;
}

.medal {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 16px;
  position: relative;
  padding-bottom: 20px;
}

.medal::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: #d1d5db;
}

.medal:last-child::before {
  display: none;
}

.medal .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  z-index: 1;
  position: relative;
}

.medal .content {
  font-size: 13px;
}

.medal .name {
  font-weight: 600;
  color: var(--color-text);
}

.medal .range {
  font-size: 11px;
  color: #6b7280;
  margin: 2px 0;
}

.medal .price {
  font-size: 11px;
  font-weight: 500;
}

.medals-info {
  margin-top: 12px;
  padding: 10px;
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.medals-info svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* CTA Section */
.challenge-cta-section {
  padding: 0 20px 24px;
}

.btn-lg {
  font-size: 15px;
  padding: 14px;
}

.challenge-started-badge {
  padding: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 13px;
  color: #059669;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================================
   Challenge Image Handling
   ============================================================================ */

.challenge-icon-wrapper {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  overflow: hidden;
  position: relative;
}

.challenge-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.challenge-icon-emoji {
  font-size: 48px;
  line-height: 1;
}

/* Small icon in cards */
.challenge-card-icon-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.challenge-card-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.challenge-card-icon-emoji {
  font-size: 20px;
  line-height: 1;
}

/* Group icon in accordion */
.challenge-group-icon-wrapper {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.challenge-group-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.challenge-group-icon-emoji {
  font-size: 24px;
  line-height: 1;
}

/* Image loading state */
.challenge-icon-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: var(--color-text-light);
}


.segments-tables-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segment-table-card {
  background: rgba(245, 245, 247, 0.5);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.table-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-card-title svg {
  color: var(--color-text-muted);
}

.segment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.segment-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.segment-table tbody td {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.segment-table tbody tr:last-child td {
  border-bottom: none;
}

.td-label {
  color: var(--color-text);
  font-weight: 500;
  text-transform: capitalize;
}

.td-value {
  color: var(--color-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.td-pct {
  color: var(--color-text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.td-completed {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.segment-summary-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.summary-row:last-of-type {
  margin-bottom: 0;
}

.summary-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.summary-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}


.author-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn.danger {
    color: #ef4444;
    border-color: #fee2e2;
}

.icon-btn:hover {
    filter: brightness(1.05);
}

/* ============================================================================
   PLIK: assets/css/edit-route-modal.css
   Edit Route Modal - Dedykowany namespace
   ============================================================================ */

/* ========================================================================
   MODAL OVERLAY & CONTAINER
   ======================================================================== */

.edit-route-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.edit-route-modal__container {
  background: white;
  border-radius: var(--radius-lg);
  width: 95vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* ========================================================================
   HEADER
   ======================================================================== */

.edit-route-modal__header {
  padding: 24px 32px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, white, #fafafa);
  flex-shrink: 0;
}

.edit-route-modal__header-content {
  flex: 1;
}

.edit-route-modal__title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--font-light);
  letter-spacing: 0.02em;
}

.edit-route-modal__subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.edit-route-modal__subtitle-separator {
  margin: 0 8px;
}

.edit-route-modal__close-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-route-modal__close-btn:hover {
  background: var(--color-background-light);
}

/* ========================================================================
   BODY - 3 COLUMN LAYOUT
   ======================================================================== */

.edit-route-modal__body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

/* ========================================================================
   COLUMNS
   ======================================================================== */

.edit-route-modal__column {
  padding: 32px;
  overflow-y: auto;
}

.edit-route-modal__column--basic {
  border-right: 1px solid var(--color-border-light);
}

.edit-route-modal__column--photos {
  border-right: 1px solid var(--color-border-light);
  background: #fafafa;
}

.edit-route-modal__column--advanced {
  background: white;
}

.edit-route-modal__column-title {
  margin: 0 0 20px 0;
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-route-modal__column-icon {
  width: 16px;
  height: 16px;
}

/* ========================================================================
   FORM ELEMENTS
   ======================================================================== */

.edit-route-modal__form-group {
  margin-bottom: 20px;
}

.edit-route-modal__form-label {
  display: block;
  font-weight: var(--font-semibold);
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 6px;
}

.edit-route-modal__form-hint {
  display: block;
  font-weight: var(--font-normal);
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 2px;
}

.edit-route-modal__form-input,
.edit-route-modal__form-textarea,
.edit-route-modal__form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: white;
  transition: all var(--transition);
}

.edit-route-modal__form-input:focus,
.edit-route-modal__form-textarea:focus,
.edit-route-modal__form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-route-modal__form-textarea {
  resize: vertical;
  font-family: inherit;
}

.edit-route-modal__char-counter {
  text-align: right;
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 4px;
}

.edit-route-modal__time-display {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ========================================================================
   PHOTO UPLOAD ZONE
   ======================================================================== */

.edit-route-modal__photo-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  background: white;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-route-modal__photo-upload:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.02);
}

.edit-route-modal__photo-upload--drag-active {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
  border-style: solid;
}

.edit-route-modal__photo-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.5;
  stroke: currentColor;
}

.edit-route-modal__photo-upload-title {
  font-size: 15px;
  font-weight: var(--font-medium);
  margin-bottom: 4px;
  color: var(--color-text);
}

.edit-route-modal__photo-upload-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
}

.edit-route-modal__photo-upload-progress {
  color: var(--color-primary);
}

.edit-route-modal__photo-upload-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========================================================================
   PHOTO GRID
   ======================================================================== */

.edit-route-modal__photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.edit-route-modal__photo-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
}

.edit-route-modal__photo-card--primary {
  border-color: #10b981;
  box-shadow: 0 0 0 1px #10b981;
}

.edit-route-modal__photo-card:hover .edit-route-modal__photo-actions {
  opacity: 1;
}

.edit-route-modal__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-route-modal__photo-badge {
  position: absolute;
  top: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.edit-route-modal__photo-badge--primary {
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #10b981;
}

.edit-route-modal__photo-badge--gps {
  right: 8px;
  background: rgba(59, 130, 246, 0.9);
  color: white;
}

.edit-route-modal__photo-badge-icon {
  width: 12px;
  height: 12px;
}

.edit-route-modal__photo-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 12px 8px 8px;
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.edit-route-modal__photo-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-route-modal__photo-btn:hover {
  background: white;
}

.edit-route-modal__photo-btn--delete {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.edit-route-modal__photo-btn--delete:hover {
  background: rgba(239, 68, 68, 1);
}

/* ========================================================================
   PHOTO CAPTION EDITOR
   ======================================================================== */

.edit-route-modal__caption-editor {
  margin-top: 16px;
  padding: 16px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.edit-route-modal__caption-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.edit-route-modal__empty-state {
  text-align: center;
  padding: 32px;
  color: var(--color-text-light);
}

.edit-route-modal__empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.3;
  stroke: currentColor;
}

.edit-route-modal__empty-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.edit-route-modal__empty-subtitle {
  font-size: 12px;
  margin-top: 4px;
}

/* ========================================================================
   LAYER CHECKBOXES
   ======================================================================== */

.edit-route-modal__layer-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.edit-route-modal__layer-item {
  display: block;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.edit-route-modal__layer-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.edit-route-modal__layer-item--checked {
  background: rgba(59, 130, 246, 0.1);
}

.edit-route-modal__layer-checkbox {
  margin-right: 8px;
}

.edit-route-modal__layer-name {
  font-size: 13px;
}

.edit-route-modal__layer-count {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 8px;
}

/* ========================================================================
   ROAD TYPES
   ======================================================================== */

.edit-route-modal__road-types {
  background: #f5f5f7;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.edit-route-modal__road-type-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.edit-route-modal__road-type-row:last-child {
  margin-bottom: 0;
}

.edit-route-modal__road-type-label {
  font-size: 12px;
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-route-modal__road-type-icon {
  width: 14px;
  height: 14px;
}

.edit-route-modal__road-type-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-align: right;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.edit-route-modal__road-types-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.edit-route-modal__road-types-total {
  font-size: 12px;
  color: var(--color-text-muted);
}

.edit-route-modal__road-types-total--invalid {
  color: #ef4444;
  font-weight: var(--font-semibold);
}

.edit-route-modal__road-types-total--valid {
  color: #10b981;
  font-weight: var(--font-semibold);
}

.edit-route-modal__road-types-normalize {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-route-modal__road-types-normalize:hover {
  background: var(--color-background-light);
}

/* ========================================================================
   STATS (Read-only)
   ======================================================================== */

.edit-route-modal__stats {
  background: #f5f5f7;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.edit-route-modal__stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.edit-route-modal__stat-row:last-child {
  margin-bottom: 0;
}

.edit-route-modal__stat-label {
  color: var(--color-text-muted);
}

.edit-route-modal__stat-value {
  font-weight: var(--font-semibold);
}

/* ========================================================================
   GPX FILE INFO
   ======================================================================== */

.edit-route-modal__gpx-info {
  background: #f5f5f7;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.edit-route-modal__gpx-path {
  word-break: break-all;
  margin-bottom: 8px;
}

.edit-route-modal__gpx-download {
  display: inline-block;
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 11px;
  transition: all var(--transition);
}

.edit-route-modal__gpx-download:hover {
  background: var(--color-background-light);
}

/* ========================================================================
   FOOTER
   ======================================================================== */

.edit-route-modal__footer {
  padding: 20px 32px;
  border-top: 2px solid var(--color-border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: white;
  flex-shrink: 0;
}

.edit-route-modal__footer-left {
  flex: 1;
}

.edit-route-modal__footer-right {
  display: flex;
  gap: 12px;
}

.edit-route-modal__alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-route-modal__alert--error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c00;
}

.edit-route-modal__alert--success {
  background: #efe;
  border: 1px solid #cfc;
  color: #070;
}

.edit-route-modal__alert-icon {
  width: 16px;
  height: 16px;
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.edit-route-modal__btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.edit-route-modal__btn--outline {
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.edit-route-modal__btn--outline:hover {
  background: var(--color-background-light);
}

.edit-route-modal__btn--primary {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: white;
}

.edit-route-modal__btn--primary:hover {
  background: var(--color-primary-dark);
}

.edit-route-modal__btn--primary:disabled {
  background: var(--color-border);
  border-color: var(--color-border);
  cursor: not-allowed;
  opacity: 0.6;
}

.edit-route-modal__btn-icon {
  width: 16px;
  height: 16px;
}

.edit-route-modal__btn-spinner {
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

/* ========================================================================
   SCROLLBAR
   ======================================================================== */

.edit-route-modal__column::-webkit-scrollbar {
  width: 4px;
}

.edit-route-modal__column::-webkit-scrollbar-track {
  background: transparent;
}

.edit-route-modal__column::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.edit-route-modal__column::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 1024px) {
  .edit-route-modal__body {
    grid-template-columns: 1fr;
  }

  .edit-route-modal__column--basic,
  .edit-route-modal__column--photos {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }
}

@media (max-width: 640px) {
  .edit-route-modal__container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .edit-route-modal__header {
    padding: 16px 20px;
  }

  .edit-route-modal__title {
    font-size: 18px;
  }

  .edit-route-modal__column {
    padding: 20px;
  }

  .edit-route-modal__photo-grid {
    grid-template-columns: 1fr;
  }

  .edit-route-modal__footer {
    padding: 16px 20px;
    flex-direction: column;
  }

  .edit-route-modal__footer-left,
  .edit-route-modal__footer-right {
    width: 100%;
  }

  .edit-route-modal__footer-right {
    flex-direction: column;
  }
}

/* ============================================================================
   CHALLENGE DETAILS PANEL - MEDALS FIX
   ============================================================================ */

.challenge-medals-wrapper {
  padding: 0 20px 20px;
}

.challenge-medals-earned {
  margin-bottom: 24px;
}

.medals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.challenge-completed-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.challenge-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.03);
  overflow: hidden;
  position: relative;
}

.challenge-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.challenge-icon-emoji {
  font-size: 40px;
}

/* Route Details Specific Styles */
.details-container {
    height: 100%;
    overflow-y: auto;
    background: white;
}

.details-header {
    padding: 16px 12px 12px;
    border-bottom: 1px solid var(--color-border-light);
}

.details-header.completed {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.03) 0%, transparent 100%);
}

.details-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.details-title {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0;
    color: var(--color-text);
    flex: 1;
}

.completion-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.completion-icon {
    width: 12px;
    height: 12px;
    filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(86deg) brightness(97%) contrast(97%);
}

.completion-text {
    font-size: 10px;
    font-weight: 600;
    color: #059669;
    letter-spacing: 0.02em;
}

.tagline-quote {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.03);
    border-left: 3px solid rgba(139, 92, 246, 0.4);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
    font-style: italic;
}

.badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-reference {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #2563eb;
}

.badge-activity {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.badge-route-type {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4f46e5;
}

.badge-challenge {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
    color: #7c3aed;
}

.badge-icon {
    width: 11px;
    height: 11px;
    margin-right: 3px;
}

.accent-line {
    height: 3px;
    width: 50px;
    border-radius: 2px;
    margin-top: 12px;
    opacity: 0.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* ✅ Gdy jest czas - zawsze 2x2 (nie mieści się 4 w linii) */
    .stats-grid.has-time {
        grid-template-columns: repeat(2, 1fr);
    }
}


.road-types-card {
    background: rgba(245, 245, 247, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
}

.road-types-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.road-types-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.road-types-list {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.road-type-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.road-type-icon {
    width: 10px;
    height: 10px;
    opacity: 0.5;
}

.road-type-name {
    font-size: 11px;
    color: var(--color-text);
}

.road-type-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

.description-card {
    background: rgba(245, 245, 247, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.description-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.section-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text);
    margin: 0 0 10px 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title img {
    width: 13px;
    height: 13px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.photo-card {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #eee;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.photo-card.primary {
    border-color: #10b981;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-badge {
    position: absolute;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.photo-badge.primary {
    top: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #10b981;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.photo-badge.gps {
    top: 6px;
    right: 6px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.photo-badge img {
    width: 9px;
    height: 9px;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 8px 8px;
    color: white;
    font-size: 10px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-card:hover .photo-caption {
    opacity: 1;
}

.layers-details {
    background: rgba(245, 245, 247, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.layers-summary {
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.layers-summary img.chevron {
    width: 11px;
    height: 11px;
    margin-left: auto;
    transition: transform 0.2s;
}

.layers-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-item {
    padding: 8px 10px;
    background: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--color-border-light);
}

.layer-item img {
    width: 11px;
    height: 11px;
}

.challenge-section {
    background: rgba(245, 245, 247, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.challenge-loading {
    text-align: center;
    padding: 20px;
    color: var(--color-text-light);
}

.challenge-loading img {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-bottom: 8px;
}

.challenge-loading div {
    font-size: 12px;
}

.ratings-section {
    background: rgba(245, 245, 247, 0.5);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.ratings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.review-card {
    padding: 10px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    border: 1px solid var(--color-border-light);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.review-date {
    font-size: 10px;
    color: var(--color-text-light);
}

.review-comment {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

.empty-reviews {
    text-align: center;
    padding: 20px;
    color: var(--color-text-light);
    font-size: 12px;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.author-section {
    border-top: 1px solid var(--color-border-light);
    padding-top: 12px;
}

.author-section-title {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-light);
    margin: 0 0 10px 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.author-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.icon-btn img {
    width: 16px;
    height: 16px;
}

.icon-btn.danger {
    color: #ef4444;
    border-color: #fee2e2;
}

.meta-info {
    padding: 12px;
    border-top: 1px solid var(--color-border-light);
    font-size: 10px;
    color: var(--color-text-light);
    text-align: center;
}

.meta-info img {
    width: 11px;
    height: 11px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.section-padding {
    padding: 0 12px 12px;
}

.svg-white {
    filter: brightness(0) invert(1);
}

.live-user-marker {
    transition: all 0.2s ease;
}

.live-user-marker:hover {
    z-index: 1000 !important;
}


.challenge-hero {
    position: relative; /* Już może być, ale dla pewności */
}

.challenge-plan-btn {
    position: absolute;
    top: 16px;
    right: 16px;  /* ✅ z prawej */
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-primary, #6366f1);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    transition: all 0.2s ease;
    z-index: 10;
}

.challenge-plan-btn:hover {
    background: var(--color-primary-dark, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.challenge-plan-btn .svg-white {
    flex-shrink: 0;
}
