/* ==========================================================================
   PORTFOLIO VAULT — MINIMALIST LUXURY WEBSITE SELLER MARKETPLACE & DRM
   Clean, focused, modern monochrome palette with single refined cyan accent
   ========================================================================== */

:root {
  --bg-main: #07090e;
  --bg-surface: #0e121c;
  --bg-card: rgba(15, 19, 30, 0.85);
  --bg-card-hover: rgba(22, 28, 45, 0.95);
  
  --accent-cyan: #00e5ff;
  --accent-cyan-glow: rgba(0, 229, 255, 0.25);
  --accent-blue: #2563eb;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 229, 255, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.6;
}

/* ==================== DRM SECURITY & ANTI-CAPTURE ==================== */
#anti-recording-shield {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.95);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.recording-protected #anti-recording-shield {
  opacity: 1;
  pointer-events: auto;
}

.shield-card {
  text-align: center;
  max-width: 440px;
  padding: 2.5rem;
  background: #0f1422;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.9);
}

/* Watermark Overlay */
.watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.02) 30px,
    transparent 30px,
    transparent 90px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow: hidden;
}

.watermark-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: 0.2em;
  transform: rotate(-25deg);
  white-space: nowrap;
  user-select: none;
}

#security-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #111625;
  border: 1px solid var(--accent-cyan);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 20px var(--accent-cyan-glow);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#security-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== NAVBAR & PANELS ==================== */
.glass-nav {
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 800;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px var(--accent-cyan-glow);
  text-decoration: none;
  font-size: 0.88rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.45);
  background: #33eaff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  text-decoration: none;
  font-size: 0.88rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==================== TEMPLATE GRID ==================== */
#catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  width: 100%;
}

@media (max-width: 640px) {
  #catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== SELLER TEMPLATE CARD ==================== */
.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.template-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 255, 0.15);
}

.template-card .thumb-box {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #090c14;
}

.template-card .thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-card:hover .thumb-box img {
  transform: scale(1.05);
}

.img-shield {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  cursor: pointer;
}

/* ==================== 3D INTERACTIVE CARD STACK ==================== */
.deck-container {
  position: relative;
  width: 330px;
  height: 430px;
  perspective: 1200px;
  margin: 0 auto;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: #0f1320;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, z-index 0.6s;
  display: flex;
  flex-direction: column;
}

.deck-card.pos-0 {
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  z-index: 4;
  opacity: 1;
  border-color: var(--accent-cyan);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9), 0 0 25px var(--accent-cyan-glow);
}

.deck-card.pos-1 {
  transform: translate3d(12px, 16px, -40px) scale(0.96) rotate(3deg);
  z-index: 3;
  opacity: 0.88;
}

.deck-card.pos-2 {
  transform: translate3d(-10px, 30px, -80px) scale(0.92) rotate(-3deg);
  z-index: 2;
  opacity: 0.75;
}

.deck-card.pos-3 {
  transform: translate3d(18px, 44px, -120px) scale(0.88) rotate(5deg);
  z-index: 1;
  opacity: 0.6;
}

.deck-card.fly-away {
  transform: translate3d(360px, -60px, 60px) rotate(26deg) scale(0.9);
  opacity: 0;
}

/* ==================== PREVIEW DRAWER ==================== */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

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

.preview-content {
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  background: #090c14;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
}

.preview-header {
  padding: 1rem 1.5rem;
  background: #0b0f1a;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-switcher {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.device-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.device-btn.active, .device-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.preview-frame-container {
  flex: 1;
  background: #030407;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 1rem;
}

.mockup-frame {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.mockup-frame.tablet { width: 768px; }
.mockup-frame.mobile { width: 375px; }
.mockup-frame iframe { width: 100%; height: 100%; border: none; }

/* ==================== CHECKOUT MODAL ==================== */
.checkout-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

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

.checkout-box {
  width: 100%;
  max-width: 500px;
  background: #0d121e;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.95);
  position: relative;
}

/* ==================== FLOATING CHAT WIDGET ==================== */
.chat-floating-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent-cyan);
  color: #000;
  padding: 12px 22px;
  border-radius: 100px;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 10px 30px var(--accent-cyan-glow);
  transition: transform 0.25s;
  border: none;
}
.chat-floating-pill:hover {
  transform: translateY(-2px);
  background: #33eaff;
}

.chat-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: 92vw;
  height: 520px;
  max-height: 80vh;
  background: #0b0f1a;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.95);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.chat-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #1a2030; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }
