/* components.css - Cards, Modals, Badges, Tabs */

/* MTG Card Component */
.card-item {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--card-radius);
  background: #111;
  border: 1px solid #444;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.card-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(56, 139, 253, 0.35);
  border-color: var(--accent-blue);
  z-index: 10;
}

.card-item.tapped {
  transform: rotate(90deg) scale(0.95);
  filter: brightness(0.85);
  margin: 0 16px;
}
.card-item.tapped:hover {
  transform: rotate(90deg) scale(1.0);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background-color: #1a1a1a;
}

.card-fallback {
  width: 100%;
  height: 100%;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #2b303c, #161a22);
}

.card-fallback-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.card-fallback-cost {
  font-size: 10px;
  color: var(--accent-gold);
}

.card-fallback-type {
  font-size: 9px;
  color: var(--text-muted);
}

.card-overlay-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: #fff;
  border: 1px solid #555;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  font-size: 14px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface);
}

/* Action Popover Menu */
.action-popover {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 4px 0;
}

.action-popover-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-popover-item:hover {
  background: var(--accent-blue);
  color: #fff;
}
