/* AI_TAG: FRONTEND_COMPONENT | Pigeon Coop styling */

/* ======================================
   PIGEON COOP CONTAINER
   ====================================== */

.pigeon-coop-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.pigeon-coop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color, #ddd);
}

.pigeon-coop-header h1 {
  font-size: 2em;
  margin: 0;
  color: var(--text-primary, #333);
}

.slots-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.slots-count {
  font-size: 1.2em;
  font-weight: bold;
  padding: 8px 15px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  color: var(--text-primary, #333);
}

.btn-buy-slot,
.btn-create-pigeon {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy-slot {
  background: var(--color-feathers, #f39c12);
  color: white;
}

.btn-buy-slot:hover {
  background: var(--color-feathers-dark, #e67e22);
  transform: translateY(-2px);
}

.btn-create-pigeon {
  background: var(--color-primary, #3498db);
  color: white;
}

.btn-create-pigeon:hover {
  background: var(--color-primary-dark, #2980b9);
  transform: translateY(-2px);
}

/* ======================================
   CONTROLS (FILTERS & SORT)
   ====================================== */

.pigeon-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--border-color, #ddd);
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9em;
  font-weight: 500;
}

.filter-btn:hover {
  border-color: var(--color-primary, #3498db);
  background: var(--bg-hover, #f0f8ff);
}

.filter-btn.active {
  background: var(--color-primary, #3498db);
  border-color: var(--color-primary, #3498db);
  color: white;
}

.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-dropdown label {
  font-weight: 500;
  color: var(--text-secondary, #666);
}

.sort-dropdown select {
  padding: 8px 12px;
  border: 2px solid var(--border-color, #ddd);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 1em;
}

/* ======================================
   PIGEON GRID
   ====================================== */

.pigeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pigeon-card {
  background: white;
  border: 2px solid var(--border-color, #ddd);
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pigeon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary, #3498db);
}

.pigeon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pigeon-status,
.pigeon-life-stage {
  font-size: 1.4em;
}

.rank-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: bold;
  text-transform: uppercase;
}

.rank-badge.beginner {
  background: #95a5a6;
  color: white;
}

.rank-badge.amateur {
  background: #3498db;
  color: white;
}

.rank-badge.skilled {
  background: #9b59b6;
  color: white;
}

.rank-badge.expert {
  background: #e67e22;
  color: white;
}

.rank-badge.master {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: white;
}

.rank-badge.legend {
  background: linear-gradient(135deg, #f1c40f, #e67e22, #e74c3c);
  color: white;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

/* ======================================
   PIGEON AVATAR
   ====================================== */

.pigeon-avatar {
  position: relative;
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  margin-bottom: 15px;
}

.pigeon-icon {
  font-size: 4em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.pigeon-level {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--color-xp, #9b59b6);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
}

/* ======================================
   PIGEON INFO
   ====================================== */

.pigeon-info {
  text-align: center;
}

.pigeon-name {
  font-size: 1.2em;
  margin: 0 0 5px 0;
  color: var(--text-primary, #333);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pigeon-meta {
  color: var(--text-secondary, #666);
  font-size: 0.9em;
  margin-bottom: 10px;
}

.pigeon-stats-mini {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.stat-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9em;
}

.stat-icon {
  font-size: 1.1em;
}

/* Personality SVG chip icons */
.pi-chip{ display:inline-block; vertical-align:middle; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.pi-icon{ display:inline-block; vertical-align:middle; }

.stat-value {
  font-weight: bold;
  color: var(--text-primary, #333);
}

/* ======================================
   CONDITION BARS
   ====================================== */

.pigeon-conditions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.condition-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
}

.condition-label {
  width: 50px;
  text-align: right;
  color: var(--text-secondary, #666);
  font-size: 0.9em;
}

.condition-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary, #eee);
  border-radius: 4px;
  overflow: hidden;
}

.condition-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}

.condition-value {
  width: 35px;
  text-align: left;
  font-weight: bold;
  color: var(--text-primary, #333);
  font-size: 0.9em;
}

/* ======================================
   PIGEON ACTIVITY
   ====================================== */

.pigeon-activity {
  margin-top: 10px;
  padding: 8px;
  background: var(--bg-info, #e8f4f8);
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--color-primary, #3498db);
  font-weight: 500;
}

/* ======================================
   EMPTY STATE
   ====================================== */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #666);
}

.empty-icon {
  font-size: 5em;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 1.5em;
  margin: 0 0 10px 0;
  color: var(--text-primary, #333);
}

.empty-state p {
  font-size: 1em;
  margin: 0;
}

/* ======================================
   LOADING & ERROR STATES
   ====================================== */

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #666);
  font-size: 1.1em;
}

.error-message {
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #c33;
}

.error-message button {
  margin-top: 15px;
  padding: 10px 20px;
  background: var(--color-primary, #3498db);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.error-message button:hover {
  background: var(--color-primary-dark, #2980b9);
}

/* ======================================
   RESPONSIVE
   ====================================== */

@media (max-width: 768px) {
  .pigeon-coop-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .pigeon-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .sort-dropdown {
    justify-content: center;
  }
  
  .pigeon-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .pigeon-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================
   CANDIDATE MODAL (Step 2)
   ====================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  z-index: 1000;
}
.modal-content {
  background: #0f1622;
  color: #e8eff8;
  border: 2px solid rgba(77,163,255,.35);
  border-radius: 14px;
  width: min(92vw, 760px);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(77,163,255,.1) inset;
}
.modal-header, .modal-footer {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.modal-footer { border-top: 1px solid rgba(255,255,255,.08); border-bottom: none; display:flex; gap:8px; justify-content:flex-end; }
.modal-body { padding: 12px 16px; }
.modal-header { display:flex; align-items:center; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 18px; letter-spacing: .2px; }
.modal-close { background: transparent; border: 0; color: #cfe6ff; font-size: 20px; cursor: pointer; }
.btn-primary { background: #4da3ff; color: #0b1016; border: 0; padding: 8px 14px; border-radius: 10px; font-weight: 700; cursor:pointer; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: #1a2330; color: #cfe6ff; border: 1px solid rgba(77,163,255,.3); padding: 8px 14px; border-radius: 10px; font-weight: 700; cursor:pointer; }
.btn-secondary:hover { background:#15202b; }
.candidate-row { margin-top: 4px; }
.candidate-card { background: #0c121b; border: 1px solid rgba(255,255,255,.08); }
.candidate-card:hover { border-color: #4da3ff; box-shadow: 0 0 0 2px rgba(77,163,255,.18); transform: translateY(-1px); transition: box-shadow .15s ease, transform .15s ease; }
.candidate-card .cand-stats span { background:#0f1a27; border:1px solid rgba(255,255,255,.05); padding:3px 6px; border-radius:8px; font-size:12px; }
