/* OPBinder - One Piece TCG Deck & Storage Manager - Pirate Theme */
:root {
  --bg-primary: #0b0f17;
  --bg-secondary: #131b2a;
  --bg-tertiary: #1b263b;
  --bg-card: #152238;
  --border-color: #273854;
  --text-main: #f0f4f8;
  --text-muted: #8fa0b5;
  --gold-primary: #f59e0b;
  --gold-hover: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.25);
  
  /* OPTCG Official Card Colors */
  --c-red: #ef4444;
  --c-green: #10b981;
  --c-blue: #3b82f6;
  --c-purple: #8b5cf6;
  --c-black: #475569;
  --c-yellow: #eab308;
}

* {
  box-sizing: border-box;
  margin: 0;
}

[v-cloak] {
  display: none !important;
}
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Header & Nav */
.header-bar {
  background: linear-gradient(180deg, #162032 0%, #0e1522 100%);
  border-bottom: 2px solid #20304a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-tab {
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
}
.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}
.nav-tab.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
  font-weight: 600;
  background: rgba(245, 158, 11, 0.08);
}

/* Card Visual Status & Greying Out Effects */
.card-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-color: #3b5072;
}

/* Visual Greying Out for Missing / Partial Cards */
.deck-card-visual {
  transition: filter 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
}

/* Fully Owned in Deck */
.deck-card-visual.status-ready {
  border: 2px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Partially Owned in Deck (Slightly greyed out) */
.deck-card-visual.status-partial {
  filter: grayscale(45%) contrast(90%);
  opacity: 0.88;
  border: 2px solid #f59e0b;
}

/* Missing / Unowned in Deck (Greyed out) */
.deck-card-visual.status-missing {
  filter: grayscale(85%) opacity(55%) contrast(85%);
  border: 2px dashed #ef4444;
}

/* Devil Fruit Block Badge */
.block-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #7c3aed 0%, #4c1d95 100%);
  border: 2px solid #fbbf24;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.block-badge.block-1 {
  background: radial-gradient(circle, #64748b 0%, #334155 100%);
  border-color: #94a3b8;
}
.block-badge.block-2 {
  background: radial-gradient(circle, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
}
.block-badge.block-3 {
  background: radial-gradient(circle, #16a34a 0%, #15803d 100%);
  border-color: #4ade80;
}
.block-badge.block-4 {
  background: radial-gradient(circle, #d97706 0%, #b45309 100%);
  border-color: #fbbf24;
}
.block-badge.block-5 {
  background: radial-gradient(circle, #dc2626 0%, #991b1b 100%);
  border-color: #f87171;
}

/* Color Accent Bars */
.color-bar-red { background-color: var(--c-red); }
.color-bar-green { background-color: var(--c-green); }
.color-bar-blue { background-color: var(--c-blue); }
.color-bar-purple { background-color: var(--c-purple); }
.color-bar-black { background-color: var(--c-black); }
.color-bar-yellow { background-color: var(--c-yellow); }

/* Quick +/- Counter Button */
.counter-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.counter-btn:hover {
  background: var(--gold-primary);
  color: #0b0f17;
  border-color: var(--gold-primary);
}
.counter-btn:active {
  transform: scale(0.92);
}

/* Card Filter Chips */
.filter-chip {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: #475569;
  color: var(--text-main);
}
.filter-chip.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  font-weight: 600;
}
.filter-chip.active-gold {
  background: var(--gold-primary);
  border-color: #fbbf24;
  color: #0b0f17;
  font-weight: 700;
}

/* Modal Backdrops */
.modal-backdrop {
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(6px);
}

/* Gold Glowing Button */
.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f17;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 15px var(--gold-glow);
  transition: all 0.2s ease;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}
.btn-gold:active {
  transform: translateY(1px);
}

/* Pulse Animation for Syncing */
@keyframes pulseSync {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.sync-spin {
  animation: pulseSync 1.2s linear infinite;
}

/* ================= Mobile & Tablet Optimizations ================= */

/* Smooth momentum scrolling on mobile devices */
.overflow-x-auto, .overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar hide utility for swipeable horizontal tabs and filters */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Prevent unwanted double-tap zoom delay on action buttons */
button, input, select, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Enhanced counter touch target on mobile */
@media (max-width: 640px) {
  .counter-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 14px;
  }
}

/* Responsive Modal Sheet on mobile */
@media (max-width: 640px) {
  .modal-container {
    max-height: 94vh !important;
    border-radius: 1rem !important;
    padding: 1rem !important;
    width: 100% !important;
  }
}

/* Card title 2-line clamp for consistent card heights */
.card-title-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Safe area insets for mobile notches / home indicators */
body {
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}
.header-bar {
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
}

