/**
 * Shop Modal Styles
 */

/* Modal container */
.shop-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-modal.hidden {
  display: none;
}

.shop-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.shop-modal-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.shop-modal-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.shop-name {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.shop-description {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.shop-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Offers banner */
.shop-offers-banner {
  padding: 12px 24px;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  border-bottom: 1px solid rgba(34, 197, 94, 0.3);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.shop-offers-banner.hidden {
  display: none;
}

.offer-tag {
  padding: 4px 12px;
  background: rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #22c55e;
  font-weight: 500;
}

/* Shop modal body layout */
.shop-modal-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
}

.shop-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Portrait panel */
.shop-portrait-panel {
  width: 180px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.shop-portrait-panel.hidden {
  display: none;
}

.shop-portrait-frame {
  width: 140px;
  height: 140px;
  border: 2px solid rgba(99, 102, 241, 0.5);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.shop-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-portrait-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

/* Tabs */
.shop-tabs {
  display: flex;
  padding: 0 24px;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.shop-tab:hover {
  color: rgba(255, 255, 255, 0.8);
}

.shop-tab.active {
  color: #fff;
  border-bottom-color: #6366f1;
}

.shop-tab.hidden {
  display: none;
}

/* User info bar */
.shop-user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shop-user-points {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fbbf24;
}

.points-icon {
  font-family: monospace;
}

.shop-rotation-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.shop-rotation-info.hidden {
  display: none;
}

/* Content area */
.shop-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  min-height: 300px;
}

/* Loading state */
.shop-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(255, 255, 255, 0.5);
}

.shop-loading.hidden {
  display: none;
}

.shop-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.shop-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(255, 255, 255, 0.4);
}

.shop-empty.hidden {
  display: none;
}

/* Items grid */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.shop-items-grid.hidden {
  display: none;
}

/* Item card */
.shop-item-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--rarity-color, rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
}

.shop-item-card.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.shop-item-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-item-card.disabled:hover {
  transform: none;
}

.item-icon {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 4px;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-rarity {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: capitalize;
}

.item-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 4px;
}

.item-badge.rotating {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.item-badge.special {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.item-price {
  font-weight: 600;
  color: #fbbf24;
}

.item-price.discounted {
  color: #22c55e;
}

.item-original-price {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: line-through;
  margin-left: 6px;
}

.item-stock {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.item-stock.out-of-stock {
  color: #ef4444;
}

/* Item preview panel */
.shop-item-preview {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 24px;
  align-items: center;
}

.shop-item-preview.hidden {
  display: none;
}

.preview-item-info {
  flex: 1;
}

.preview-item-name {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.preview-item-description {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.preview-item-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-item-stats .stat {
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  color: #22c55e;
}

.preview-item-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.preview-quantity {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.qty-input {
  width: 50px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  text-align: center;
  font-size: 1rem;
  border-radius: 6px;
}

.qty-input:focus {
  outline: none;
  border-color: #6366f1;
}

.preview-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.price-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.price-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fbbf24;
}

.preview-action-btn {
  padding: 12px 32px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.preview-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.1);
}

/* Message */
.shop-message {
  padding: 12px 24px;
  text-align: center;
  font-weight: 500;
}

.shop-message.hidden {
  display: none;
}

.shop-message.success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.shop-message.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.shop-message.info {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Responsive */
@media (max-width: 600px) {
  .shop-modal-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .shop-modal-body {
    flex-direction: column;
  }

  .shop-portrait-panel {
    width: 100%;
    flex-direction: row;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .shop-portrait-frame {
    width: 64px;
    height: 64px;
  }

  .shop-portrait-name {
    flex: 1;
    text-align: left;
  }

  .shop-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-item-preview {
    flex-direction: column;
    gap: 16px;
  }

  .preview-item-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Scrollbar styling */
.shop-content::-webkit-scrollbar {
  width: 8px;
}

.shop-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
