/* ==========================================================================
   CoolCards.in - Digital Business Card Studio (Editor Styles)
   ========================================================================== */

.dbe-studio {
  display: grid;
  grid-template-columns: 460px 1fr;
  min-height: calc(100vh - var(--cc-header-h, 70px));
  background: var(--cc-bg, #0b1110);
}

/* Sidebar Editor Panel */
.dbe-sidebar {
  background: linear-gradient(180deg, #101915 0%, #0c1410 100%);
  border-right: 1px solid var(--cc-border, rgba(255, 255, 255, 0.08));
  height: calc(100vh - var(--cc-header-h, 70px));
  position: sticky;
  top: var(--cc-header-h, 70px);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(197, 245, 138, 0.35) transparent !important;
}

.dbe-sidebar::-webkit-scrollbar,
.dbe-viewport::-webkit-scrollbar {
  width: 4px !important;
}

.dbe-sidebar::-webkit-scrollbar-track,
.dbe-viewport::-webkit-scrollbar-track {
  background: transparent !important;
}

.dbe-sidebar::-webkit-scrollbar-thumb,
.dbe-viewport::-webkit-scrollbar-thumb {
  background: rgba(197, 245, 138, 0.35) !important;
  border-radius: 999px !important;
}

.dbe-sidebar::-webkit-scrollbar-button,
.dbe-viewport::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.dbe-section-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dbe-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dbe-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--cc-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 14px;
}

.dbe-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.dbe-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dbe-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #2e3d36;
  transition: 0.25s;
  border-radius: 24px;
}

.dbe-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

input:checked + .dbe-slider {
  background-color: var(--cc-mint, #c5f58a);
}

input:checked + .dbe-slider:before {
  transform: translateX(20px);
  background-color: #0b1110;
}

/* Upload Thumbnails */
.dbe-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dbe-upload-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--cc-border, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
}

.dbe-upload-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--cc-border, rgba(255, 255, 255, 0.1));
}

.dbe-upload-thumb.is-circle {
  border-radius: 50%;
}

/* Preview Viewport */
.dbe-viewport {
  background: radial-gradient(circle at 50% 25%, rgba(197, 245, 138, 0.04) 0%, transparent 70%), #080d0c;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - var(--cc-header-h, 70px));
  position: relative;
  overflow-y: auto;
}

/* Smartphone Mockup Frame */
.dbe-phone-frame {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, #1d2521, #121815);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 44px;
  padding: 12px;
  box-shadow: 
    0 30px 80px -15px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(197, 245, 138, 0.05);
  position: relative;
  margin-bottom: 24px;
}

.dbe-phone-screen {
  background: var(--dbc-card-bg, #0d1411);
  border-radius: 34px;
  overflow-y: auto;
  max-height: 720px;
  position: relative;
  transition: background 0.25s ease;
}

.dbe-phone-screen::-webkit-scrollbar {
  width: 3px !important;
  height: 3px !important;
  display: block !important;
}

.dbe-phone-screen::-webkit-scrollbar-track {
  background: transparent !important;
}

.dbe-phone-screen::-webkit-scrollbar-thumb {
  background: rgba(197, 245, 138, 0.35) !important;
  border-radius: 999px !important;
  border: none !important;
  transition: background 0.2s ease, box-shadow 0.2s ease !important;
}

.dbe-phone-screen::-webkit-scrollbar-thumb:hover {
  background: var(--cc-mint, #c5f58a) !important;
  box-shadow: 0 0 10px rgba(197, 245, 138, 0.7) !important;
}

.dbe-phone-screen::-webkit-scrollbar-corner {
  background: transparent !important;
}

.dbe-phone-screen::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

@supports not selector(::-webkit-scrollbar) {
  .dbe-phone-screen {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(197, 245, 138, 0.35) transparent !important;
  }
}

/* Smartphone Notch / Dynamic Island */
.dbe-phone-notch {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: transparent;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dbe-island-pill {
  width: 90px;
  height: 18px;
  background: #000000;
  border-radius: 20px;
  margin-top: 4px;
}

/* Viewport Action Dock */
.dbe-dock {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 23, 19, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cc-border, rgba(255, 255, 255, 0.1));
  border-radius: 99px;
  padding: 8px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: sticky;
  bottom: 20px;
  z-index: 100;
}

/* Responsive */
@media (max-width: 1024px) {
  .dbe-studio {
    grid-template-columns: 1fr;
  }
  .dbe-sidebar {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--cc-border, rgba(255, 255, 255, 0.08));
  }
  .dbe-viewport {
    padding: 30px 16px;
    min-height: auto;
  }
}

@media (max-width: 600px) {
  .dbe-viewport {
    padding: 20px 10px;
  }
  .dbe-phone-frame {
    border-radius: 26px;
    padding: 8px;
    margin-bottom: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  }
  .dbe-phone-screen {
    border-radius: 20px;
    max-height: 640px;
  }
  .dbe-island-pill {
    width: 75px;
    height: 16px;
  }
  .dbe-dock {
    flex-wrap: wrap;
    justify-content: center;
    width: calc(100% - 16px);
    max-width: 440px;
    border-radius: 18px;
    padding: 10px;
    gap: 8px;
    bottom: 12px;
  }
  .dbe-dock .cc-hdr-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 38px;
    font-size: 11.5px;
    padding: 0 10px;
    justify-content: center;
  }
}

/* Business Card Theme Cards Grid (Media Kit & Tweet Studio Parity) */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.theme-card-box {
  border: 1.5px solid var(--cc-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}

.theme-card-box:hover {
  border-color: rgba(197, 245, 138, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.theme-card-box.active {
  border-color: var(--cc-mint, #c5f58a) !important;
  background: rgba(197, 245, 138, 0.07) !important;
  box-shadow: 0 0 14px var(--cc-mint-glow, rgba(197, 245, 138, 0.2)) !important;
}

.theme-mini-mockup {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.theme-title-text {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-card-box.active .theme-title-text {
  color: var(--cc-mint, #c5f58a);
}

.theme-hex-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}

@media (max-width: 480px) {
  .dbe-field-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dbe-media-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .theme-cards-grid {
    grid-template-columns: 1fr;
  }
  .dbe-sidebar {
    padding: 16px 12px;
  }
  .dbe-dock .cc-hdr-btn {
    flex: 1 1 100%;
  }
}

/* --------------------------------------------------------------------------
   Strict 1:1 Square QR Enforcement (Zero Side-by-Side Dual Rendering)
   -------------------------------------------------------------------------- */
.dbc-qr-box,
#prevQrContainer,
#dbcQrContainer {
  width: 154px !important;
  height: 154px !important;
  min-width: 154px !important;
  min-height: 154px !important;
  max-width: 154px !important;
  max-height: 154px !important;
  aspect-ratio: 1 / 1 !important;
  background: #ffffff !important;
  border-radius: 14px !important;
  padding: 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  margin: 0 auto 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
}

.dbc-qr-box canvas,
#prevQrContainer canvas,
#dbcQrContainer canvas {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  position: absolute !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.dbc-qr-box img,
#prevQrContainer img,
#dbcQrContainer img {
  width: 134px !important;
  height: 134px !important;
  max-width: 134px !important;
  max-height: 134px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

/* --------------------------------------------------------------------------
   Realistic Demo Profile & Style Variations System
   -------------------------------------------------------------------------- */
.dbe-demo-banner {
  background: linear-gradient(135deg, rgba(197, 245, 138, 0.08) 0%, rgba(16, 185, 129, 0.06) 100%);
  border: 1px solid rgba(197, 245, 138, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dbe-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dbe-demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(197, 245, 138, 0.18);
  color: var(--cc-mint, #c5f58a);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 99px;
}

.dbe-demo-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--cc-muted, #94a3b8);
}

.dbe-demo-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.dbe-demo-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 650;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--cc-border, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.dbe-demo-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.dbe-demo-btn.is-reset {
  color: var(--cc-mint, #c5f58a);
  border-color: rgba(197, 245, 138, 0.3);
  background: rgba(197, 245, 138, 0.08);
}

.dbe-demo-btn.is-reset:hover {
  background: rgba(197, 245, 138, 0.16);
  border-color: var(--cc-mint, #c5f58a);
}

/* 5 Style Variations Filter / Presets Bar */
.dbe-style-variations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--cc-border, rgba(255, 255, 255, 0.08));
}

.dbe-style-pill {
  flex: 1 1 auto;
  text-align: center;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--cc-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dbe-style-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.dbe-style-pill.active {
  background: var(--cc-mint, #c5f58a);
  color: #0b1110;
  font-weight: 750;
  box-shadow: 0 2px 8px rgba(197, 245, 138, 0.25);
}
