/* ===========================================
   OLYMPUS RISING - Crafting & Upgrade CSS
   Styling for crafting, enhancement, awakening
   =========================================== */

/* ═══════════════════════════════════════════════════════════════════════════════
   CRAFTING STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.crafting-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.crafting-header {
  text-align: center;
  margin-bottom: 30px;
}

.crafting-header h2 {
  font-size: 2rem;
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  margin-bottom: 10px;
}

.crafting-subtitle {
  color: #a0a0c0;
  font-style: italic;
}

/* Stations Grid */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.station-card {
  background: linear-gradient(135deg, #2a2a4a 0%, #1e1e3a 100%);
  border: 2px solid #3a3a5a;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.station-card:hover:not(.locked) {
  border-color: #ffd700;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.station-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.station-card .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #888;
  font-size: 1rem;
}

.station-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.station-name {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 10px;
}

.station-desc {
  color: #a0a0c0;
  font-size: 0.9rem;
}

/* Recipes Panel */
.recipes-panel {
  background: linear-gradient(135deg, #1e1e3a 0%, #151528 100%);
  border: 2px solid #3a3a5a;
  border-radius: 15px;
  padding: 25px;
}

.recipes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #3a3a5a;
}

.recipes-header h3 {
  font-size: 1.5rem;
  color: #ffd700;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.recipe-card {
  background: #2a2a4a;
  border: 2px solid #3a3a5a;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 15px;
  position: relative;
}

.recipe-card:hover {
  border-color: #6366f1;
  transform: translateX(5px);
}

.recipe-card.cannot-craft {
  opacity: 0.6;
}

.recipe-card.rarity-uncommon { border-left: 4px solid #22c55e; }
.recipe-card.rarity-rare { border-left: 4px solid #3b82f6; }
.recipe-card.rarity-epic { border-left: 4px solid #a855f7; }
.recipe-card.rarity-legendary { border-left: 4px solid #f59e0b; }
.recipe-card.rarity-mythic { border-left: 4px solid #eab308; }

.recipe-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.recipe-info {
  flex: 1;
}

.recipe-name {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 500;
  margin-bottom: 5px;
}

.recipe-output {
  color: #22c55e;
  font-size: 0.85rem;
  margin-top: 5px;
}

.recipe-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.mat-mini {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.mat-mini.has-enough { color: #22c55e; }
.mat-mini.needs-more { color: #ef4444; }
.mat-more { color: #888; font-size: 0.75rem; }

.recipe-locked {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #888;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Craft Modal */
.craft-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.craft-modal-content {
  background: linear-gradient(135deg, #2a2a4a 0%, #1e1e3a 100%);
  border: 2px solid #6366f1;
  border-radius: 15px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.craft-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #3a3a5a;
}

.craft-modal-header h3 {
  color: #ffd700;
  font-size: 1.3rem;
}

.btn-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close:hover {
  color: #fff;
}

.craft-modal-body {
  padding: 20px;
}

.craft-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.craft-icon {
  font-size: 4rem;
}

.craft-details {
  flex: 1;
}

.craft-time, .craft-xp {
  color: #a0a0c0;
  font-size: 0.9rem;
  margin: 5px 0;
}

.craft-materials {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.craft-materials h4 {
  color: #ffd700;
  margin-bottom: 10px;
}

.material-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #3a3a5a;
}

.material-row:last-child {
  border-bottom: none;
}

.material-row.has-enough .mat-count { color: #22c55e; }
.material-row.needs-more .mat-count { color: #ef4444; }

.craft-quantity {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controls span {
  font-size: 1.3rem;
  color: #fff;
  min-width: 30px;
  text-align: center;
}

.craft-output {
  margin-bottom: 20px;
}

.craft-output h4 {
  color: #22c55e;
  margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   UPGRADE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.upgrade-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.upgrade-header {
  margin-bottom: 25px;
}

.upgrade-header h2 {
  font-size: 2rem;
  color: #ffd700;
  text-align: center;
  margin-bottom: 20px;
}

.upgrade-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upgrade-tab {
  background: #2a2a4a;
  border: 2px solid #3a3a5a;
  border-radius: 10px;
  padding: 12px 20px;
  color: #a0a0c0;
  cursor: pointer;
  transition: all 0.2s;
}

.upgrade-tab:hover {
  border-color: #6366f1;
  color: #fff;
}

.upgrade-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: #6366f1;
  color: #fff;
}

.upgrade-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 25px;
}

/* Upgrade Inventory */
.upgrade-inventory {
  background: linear-gradient(135deg, #1e1e3a 0%, #151528 100%);
  border: 2px solid #3a3a5a;
  border-radius: 15px;
  padding: 20px;
}

.upgrade-inventory h3 {
  color: #ffd700;
  margin-bottom: 15px;
}

.upgrade-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.upgrade-item-card {
  background: #2a2a4a;
  border: 2px solid #3a3a5a;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upgrade-item-card:hover {
  border-color: #6366f1;
  transform: scale(1.05);
}

.upgrade-item-card.selected {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.upgrade-item-card.rarity-uncommon { border-color: #22c55e; }
.upgrade-item-card.rarity-rare { border-color: #3b82f6; }
.upgrade-item-card.rarity-epic { border-color: #a855f7; }
.upgrade-item-card.rarity-legendary { border-color: #f59e0b; }
.upgrade-item-card.rarity-mythic { border-color: #eab308; }

.upgrade-item-card .item-icon {
  font-size: 2rem;
}

.upgrade-item-card .item-name {
  font-size: 0.7rem;
  color: #a0a0c0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upgrade-item-card .item-enhancement {
  font-size: 0.75rem;
  color: #22c55e;
  font-weight: bold;
}

.equipped-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #6366f1;
  color: #fff;
  font-size: 0.6rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Upgrade Panel */
.upgrade-panel {
  background: linear-gradient(135deg, #1e1e3a 0%, #151528 100%);
  border: 2px solid #3a3a5a;
  border-radius: 15px;
  padding: 25px;
  min-height: 400px;
}

.no-item-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  font-size: 1.1rem;
}

/* Enhancement Panel */
.enhance-panel,
.awaken-panel,
.reforge-panel,
.salvage-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.enhance-item-preview,
.awaken-preview,
.reforge-preview,
.salvage-preview {
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.item-icon-large {
  font-size: 4rem;
  margin-bottom: 10px;
}

.enhance-item-preview h3,
.reforge-preview h3,
.salvage-preview h3 {
  color: #fff;
  margin-bottom: 10px;
}

.enhance-levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.level-current,
.level-next {
  text-align: center;
  padding: 15px 25px;
  background: #2a2a4a;
  border-radius: 10px;
}

.level-label {
  display: block;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 5px;
}

.level-value {
  display: block;
  font-size: 2rem;
  color: #ffd700;
  font-weight: bold;
}

.bonus-value {
  display: block;
  font-size: 0.85rem;
  color: #22c55e;
  margin-top: 5px;
}

.level-arrow {
  font-size: 2rem;
  color: #6366f1;
}

.enhance-progress {
  text-align: center;
}

.progress-bar {
  height: 10px;
  background: #2a2a4a;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.85rem;
  color: #888;
}

.enhance-cost,
.awaken-cost {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 15px;
}

.enhance-cost h4,
.awaken-cost h4 {
  color: #ffd700;
  margin-bottom: 10px;
}

.cost-row,
.req-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #3a3a5a;
}

.cost-row:last-child,
.req-row:last-child {
  border-bottom: none;
}

.cost-row.has-enough span:last-child { color: #22c55e; }
.cost-row.needs-more span:last-child { color: #ef4444; }

.req-row.met span:last-child { color: #22c55e; }
.req-row.not-met span:last-child { color: #ef4444; }

.enhance-rate,
.awaken-rate {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.rate-label {
  color: #a0a0c0;
}

.rate-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-left: 10px;
}

.rate-value.high { color: #22c55e; }
.rate-value.medium { color: #f59e0b; }
.rate-value.low { color: #ef4444; }

.enhance-protection {
  padding: 10px 15px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
}

.enhance-protection label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a0a0c0;
  cursor: pointer;
}

.warning-text {
  text-align: center;
  color: #f59e0b;
  font-size: 0.9rem;
}

/* Awakening specific */
.awaken-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.awaken-from,
.awaken-to {
  text-align: center;
}

.awaken-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 2rem;
  color: #ffd700;
}

.glow-rare { filter: drop-shadow(0 0 10px #3b82f6); }
.glow-epic { filter: drop-shadow(0 0 10px #a855f7); }
.glow-legendary { filter: drop-shadow(0 0 15px #f59e0b); }
.glow-mythic { filter: drop-shadow(0 0 20px #eab308); animation: mythic-pulse 2s infinite; }

@keyframes mythic-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px #eab308); }
  50% { filter: drop-shadow(0 0 30px #ffd700); }
}

.awaken-benefits {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  padding: 15px;
}

.awaken-benefits h4 {
  color: #22c55e;
  margin-bottom: 10px;
}

.awaken-benefits ul {
  list-style: none;
  padding: 0;
}

.awaken-benefits li {
  padding: 5px 0;
  color: #a0a0c0;
}

.awaken-warning {
  color: #f59e0b;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Reforge specific */
.reforge-stats {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 15px;
}

.reforge-stats h4 {
  color: #ffd700;
  margin-bottom: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #3a3a5a;
}

.stat-name {
  color: #a0a0c0;
  text-transform: capitalize;
}

.stat-value {
  color: #fff;
  font-weight: 500;
}

.lock-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
}

.reforge-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 15px;
  color: #a0a0c0;
  font-size: 0.9rem;
}

/* Salvage specific */
.salvage-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  color: #ef4444;
}

.salvage-estimate {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 15px;
}

.salvage-estimate h4 {
  color: #ffd700;
  margin-bottom: 10px;
}

.salvage-estimate ul {
  list-style: disc;
  padding-left: 20px;
  color: #a0a0c0;
}

.error-text {
  color: #ef4444;
  text-align: center;
}

/* Buttons */
.btn-large {
  width: 100%;
  padding: 15px;
  font-size: 1.1rem;
}

.btn-legendary {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  border: none;
  color: #000;
  font-weight: bold;
}

.btn-legendary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #fcd34d 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

/* Responsive */
@media (max-width: 768px) {
  .upgrade-content {
    grid-template-columns: 1fr;
  }

  .awaken-preview {
    flex-direction: column;
    gap: 15px;
  }

  .awaken-arrow {
    flex-direction: row;
  }

  .enhance-levels {
    flex-direction: column;
    gap: 10px;
  }

  .level-arrow {
    transform: rotate(90deg);
  }
}
