/* ==========================================================================
   COMPONENTS - MYBENCHSPACE DESIGN SYSTEM
   Buttons, Store Badges, Device Frames, Bento Grids, Interactive Cards
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-teal) 0%, #0B7A6D 100%);
  color: var(--text-inverted);
  box-shadow: 0 4px 14px var(--brand-teal-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-teal-light) 0%, var(--brand-teal) 100%);
  color: var(--text-inverted);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 150, 134, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--brand-navy);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-teal);
  color: var(--brand-teal);
  transform: translateY(-2px);
}

.btn-mbb {
  background: linear-gradient(135deg, var(--mbb-primary) 0%, #0369A1 100%);
  color: var(--text-inverted);
  box-shadow: 0 4px 14px var(--mbb-glow);
}

.btn-mbb:hover {
  transform: translateY(-2px);
  color: var(--text-inverted);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.btn-mywb {
  background: linear-gradient(135deg, var(--mywb-primary) 0%, #9E1F12 100%);
  color: var(--text-inverted);
  box-shadow: 0 4px 14px var(--mywb-glow);
}

.btn-mywb:hover {
  transform: translateY(-2px);
  color: var(--text-inverted);
  box-shadow: 0 6px 20px rgba(193, 57, 43, 0.35);
}

/* --- Store Badges --- */
.store-badges-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.15rem;
  background: var(--brand-navy);
  color: var(--text-inverted);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-spring);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sm);
}

.store-badge:hover {
  background: #151838;
  color: var(--text-inverted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.3);
}

.store-badge svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.store-badge-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

.store-badge-name {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.store-badge.badge-soon {
  opacity: 0.7;
  cursor: default;
  position: relative;
}

.store-badge.badge-soon:hover {
  transform: none;
}

.badge-tag-soon {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  margin-left: 0.25rem;
  font-weight: 700;
}

/* --- Interactive App Switcher (Tab Component) --- */
.app-switcher-container {
  display: flex;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.app-switcher::-webkit-scrollbar {
  display: none;
}

.app-switcher {
  scrollbar-width: none;
  display: inline-flex;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
}

.app-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-spring);
  white-space: nowrap;
}

.app-switcher-btn img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.app-switcher-btn:hover {
  color: var(--brand-navy);
}

.app-switcher-btn.active {
  background: var(--brand-navy);
  color: var(--text-inverted);
  box-shadow: var(--shadow-md);
}

.app-switcher-btn[data-app="mbb"].active {
  background: var(--mbb-primary);
}

.app-switcher-btn[data-app="mywb"].active {
  background: var(--mywb-primary);
}

.app-switcher-btn[data-app="lims"].active {
  background: var(--mylims-primary);
}

/* --- Bento Grid --- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.bento-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-spring),
              border-color var(--duration-normal) var(--ease-spring);
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.bento-card.col-12 { grid-column: span 12; }
.bento-card.col-8  { grid-column: span 8; }
.bento-card.col-6  { grid-column: span 6; }
.bento-card.col-4  { grid-column: span 4; }

@media (max-width: 900px) {
  .bento-card.col-8,
  .bento-card.col-6,
  .bento-card.col-4 {
    grid-column: span 12;
  }
}

.bento-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.bento-icon-box.teal {
  background: var(--brand-mint);
  color: var(--brand-teal);
}

.bento-icon-box.blue {
  background: var(--mbb-light);
  color: var(--mbb-primary);
}

.bento-icon-box.red {
  background: var(--mywb-light);
  color: var(--mywb-primary);
}

.bento-icon-box.purple {
  background: var(--mylims-light);
  color: var(--mylims-primary);
}

.bento-title {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.bento-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   CSS DEVICE MOCKUP 1: REALISTIC IPHONE FOR MyBlot (WITH REAL APP VIDEO)
   ========================================================================== */
.iphone-frame {
  width: 304px;
  height: 628px;
  background: #0B0E14;
  border-radius: 46px;
  padding: 12px;
  box-shadow: 0 0 0 3px #374151,
              0 25px 60px -15px rgba(0, 0, 0, 0.4),
              0 0 24px rgba(193, 57, 43, 0.16);
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Sleek Bezel Speaker Notch (doesn't cover "WB test" title in the video) */
.iphone-island {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 5px;
  background: #262C36;
  border-radius: 99px;
  z-index: 25;
}

.mywb-phone-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

/* Screen */
.iphone-screen {
  width: 100%;
  height: 100%;
  background: #0E231F;
  border-radius: 35px;
  overflow: hidden;
  position: relative;
  display: flex;
  cursor: pointer;
}

.iphone-screen-video {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  border-radius: 35px;
}

/* ==========================================================================
   MYBENCHBOOK REAL UI SHOWCASE: IL QUADERNO + L'EDITOR (FROM SCREENSHOTS)
   ========================================================================== */
.mbb-showcase-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.mbb-pair-showcase {
  position: relative;
  width: 100%;
  max-width: 590px;
  margin: 0 auto;
  padding: 10px 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* --- 1. L'EDITOR REALE (Schermata "Test") --- */
.mbb-real-editor {
  width: 90%;
  background: #EAF4F2;
  border-radius: 22px;
  padding: 16px 18px 0 18px;
  box-shadow: 0 22px 50px -12px rgba(31, 34, 72, 0.18),
              0 0 0 1px rgba(31, 34, 72, 0.08);
  position: relative;
  z-index: 2;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-spring);
}

/* Interactive Hotspot Highlighting */
[data-mbb-tip] {
  cursor: pointer;
  position: relative;
  transition: transform 0.22s var(--ease-bounce), box-shadow 0.22s ease, background-color 0.2s ease;
}

.mbb-tool-circle[data-mbb-tip]:hover,
.mbb-tool-circle[data-mbb-tip].tip-active {
  transform: scale(1.16) translateY(-2px);
  box-shadow: 0 6px 14px rgba(31, 34, 72, 0.22);
}

.mbb-tool-group-hotspot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 999px;
}

.mbb-tool-group-hotspot:hover,
.mbb-tool-group-hotspot.tip-active {
  background: #EAF4F2;
  box-shadow: 0 0 0 2px #0E9686;
}

.mbb-real-back-group[data-mbb-tip],
.mbb-real-saved[data-mbb-tip],
.mbb-real-date-row[data-mbb-tip],
.mbb-real-sheet-body[data-mbb-tip] {
  border-radius: 10px;
  padding: 3px 6px;
  margin: -3px -6px;
}

.mbb-real-back-group[data-mbb-tip]:hover,
.mbb-real-saved[data-mbb-tip]:hover,
.mbb-real-date-row[data-mbb-tip]:hover,
.mbb-real-sheet-body[data-mbb-tip]:hover {
  background: rgba(14, 150, 134, 0.10);
  box-shadow: 0 0 0 1.5px rgba(14, 150, 134, 0.35);
}

/* Header: (<) Test ............ Saved */
.mbb-real-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mbb-real-back-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mbb-real-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: #273836;
}

.mbb-real-doc-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: #273836;
}

.mbb-real-saved {
  font-size: 12.5px;
  font-weight: 700;
  color: #66797A;
}

/* Floating White Pill Toolbar */
.mbb-real-toolbar {
  background: #FFFFFF;
  border-radius: 999px;
  padding: 6px 12px 6px 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(39, 56, 54, 0.06);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mbb-real-toolbar::-webkit-scrollbar {
  display: none;
}

.mbb-tool-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mbb-tool-circle.coral  { background: #FF5A47; color: #FFFFFF; }
.mbb-tool-circle.teal   { background: #0E9686; color: #FFFFFF; }
.mbb-tool-circle.yellow { background: #F5B82E; color: #273836; }

.mbb-tool-text {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #273836;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  white-space: nowrap;
}

.mbb-tool-icon {
  color: #5C6F6D;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.mbb-tool-sep {
  width: 1px;
  height: 18px;
  background: #E2ECEA;
  flex-shrink: 0;
  margin: 0 1px;
}

/* White Rounded A4 Sheet Card */
.mbb-real-sheet {
  background: #FFFFFF;
  border-radius: 18px 18px 22px 22px;
  padding: 20px 22px 28px 22px;
  min-height: 235px;
  box-shadow: 0 -1px 4px rgba(39, 56, 54, 0.03);
}

.mbb-real-date-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #0E9686;
  margin-bottom: 6px;
}

.mbb-real-sheet-body {
  display: block;
  margin-top: 2px;
}

.mbb-real-entry-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: #FF5A47;
  margin-bottom: 14px;
}

.mbb-real-placeholder {
  font-size: 14px;
  color: #66797A;
  font-weight: 400;
}

/* --- 2. IL QUADERNO REALE ("Quaderno esperimenti") --- */
.mbb-real-notebook-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 205px;
  height: 272px;
  z-index: 5;
  transition: transform 0.38s var(--ease-bounce), filter 0.3s ease;
  filter: drop-shadow(0 18px 32px rgba(20, 35, 34, 0.24));
}

.mbb-real-notebook-wrap:hover,
.mbb-real-notebook-wrap.tip-active {
  transform: translateY(-8px) rotate(2deg) scale(1.04);
  filter: drop-shadow(0 24px 38px rgba(14, 150, 134, 0.34));
}

/* Blocco pagine sporgente a destra e in basso (come nello screenshot) */
.mbb-real-notebook-pages {
  position: absolute;
  top: 8px;
  left: 12px;
  right: -8px;
  bottom: -9px;
  background: repeating-linear-gradient(
    to bottom,
    #F3F7F6 0px,
    #F3F7F6 3px,
    #DCE4E2 3px,
    #DCE4E2 4px
  );
  border: 1.5px solid #C8D4D2;
  border-radius: 6px 20px 22px 10px;
  z-index: 1;
}

/* Copertina Teal con dorso cucito a sx ed elastico a dx */
.mbb-real-notebook-cover {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0E9686;
  border-radius: 5px 18px 18px 5px;
  overflow: hidden;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px 0 30px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Dorso sinistro più scuro con cucitura tratteggiata */
.mbb-real-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: #0B7065;
  display: flex;
  justify-content: center;
}

.mbb-real-spine::after {
  content: "";
  width: 2px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 6px,
    rgba(255, 255, 255, 0.55) 6px,
    rgba(255, 255, 255, 0.55) 14px
  );
}

/* Elastico verticale destro */
.mbb-real-elastic {
  position: absolute;
  right: 18px;
  top: 0;
  bottom: 0;
  width: 10px;
  background: #0B7065;
}

/* Etichetta centrale bianca "Quaderno esperimenti / 5 experiments" */
.mbb-real-label {
  position: relative;
  z-index: 3;
  width: 100%;
  background: #F4FAF8;
  border: 2px solid #D5E5E2;
  border-radius: 14px;
  padding: 14px 13px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mbb-real-label-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.12;
  color: #273836;
  letter-spacing: -0.02em;
}

.mbb-real-label-divider {
  height: 1.5px;
  background: #CFDCD9;
  margin: 10px 0 8px 0;
}

.mbb-real-label-count {
  font-size: 12px;
  font-weight: 800;
  color: #778987;
}

/* --- 3. FINESTRA DI DIALOGO FLOATING AL PASSAGGIO DEL MOUSE --- */
.mbb-hover-dialog {
  position: absolute;
  z-index: 30;
  width: 265px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border: 2px solid #1F2248;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 18px 38px -8px rgba(31, 34, 72, 0.26),
              0 4px 0 #1F2248;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.24s var(--ease-bounce), top 0.18s ease, left 0.18s ease;
}

.mbb-hover-dialog.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mbb-hover-dialog::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-right: 2px solid #1F2248;
  border-bottom: 2px solid #1F2248;
  transform: rotate(45deg);
  left: var(--arrow-left, 50%);
  margin-left: -6px;
  bottom: -8px;
}

.mbb-hover-dialog.arrow-top::after {
  bottom: auto;
  top: -8px;
  transform: rotate(-135deg);
}

.mbb-dialog-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
  background: #EAF4F2;
  color: #0E9686;
}

.mbb-dialog-badge.coral  { background: #FFE8E5; color: #E03E2D; }
.mbb-dialog-badge.teal   { background: #E3F6F3; color: #0B7A6D; }
.mbb-dialog-badge.yellow { background: #FEF3C7; color: #B45309; }
.mbb-dialog-badge.navy   { background: #EEF2FF; color: #1F2248; }

.mbb-dialog-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: #1F2248;
  margin-bottom: 4px;
  line-height: 1.25;
}

.mbb-dialog-desc {
  font-size: 12.2px;
  line-height: 1.45;
  color: #4B5B59;
  font-weight: 600;
  margin: 0;
}

.mbb-interactive-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #FFFFFF;
  border: 1.5px solid #D5E5E2;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #3E5250;
  box-shadow: 0 2px 8px rgba(31, 34, 72, 0.05);
}

.mbb-hint-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0E9686;
  box-shadow: 0 0 0 4px rgba(14, 150, 134, 0.2);
}

@media (max-width: 640px) {
  .iphone-frame {
    width: 250px;
    height: 516px;
    border-radius: 40px;
    padding: 10px;
  }
  .mbb-pair-showcase {
    flex-direction: column;
    padding: 0;
    gap: 1.25rem;
  }
  .mbb-real-editor {
    width: 100%;
  }
  .mbb-real-notebook-wrap {
    position: relative;
    width: 185px;
    height: 246px;
  }
}

/* Status Chip */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-pill.status-available {
  background: var(--brand-mint);
  color: var(--brand-teal);
}

.status-pill.status-soon {
  background: #EDE9FE;
  color: var(--mylims-primary);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
