/* Store moduli — Fase 0 */

/* Modulo in iframe: riempie il corpo finestra senza scroll esterno. */
.os-window-body:has(iframe.module-frame) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.os-window-body iframe.module-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  display: block;
  background: #fff;
}

/* Finestra Store */
.store-toolbar {
  padding: 12px 14px 0;
}

.store-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.store-search-icon {
  color: rgba(255, 255, 255, 0.45);
  font-size: 15px;
  line-height: 1;
}

.store-search {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  padding: 10px 0;
  outline: none;
}

.store-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.store-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.store-empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.store-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.store-card.is-installing,
.store-card.is-uninstalling {
  pointer-events: none;
}

.store-card.is-installing .store-card-icon,
.store-card.is-uninstalling .store-card-icon {
  opacity: 0.38;
  filter: grayscale(0.15);
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
  animation: store-icon-busy 1.1s ease-in-out infinite;
}

@keyframes store-icon-busy {
  0%, 100% { opacity: 0.38; transform: scale(1); }
  50% { opacity: 0.62; transform: scale(0.94); }
}

.store-card-install.is-uninstall .store-card-install-label {
  color: rgba(255, 200, 190, 0.9);
}

.store-card-uninstall-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c62828, #ef5350);
  animation: store-install-fill var(--install-ms, 1.8s) ease-out forwards;
}

.store-install-spinner.is-uninstall {
  border-color: rgba(255, 138, 128, 0.35);
  border-top-color: #ff8a80;
}

.store-card-install {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(12, 16, 28, 0.72);
  backdrop-filter: blur(2px);
}

.store-card-install-track {
  width: min(220px, 80%);
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.store-card-install-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1565c0, #42a5f5);
  animation: store-install-fill var(--install-ms, 1.8s) ease-out forwards;
}

.store-card-install-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.01em;
}

.store-install-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: store-install-spin 0.7s linear infinite;
}

@keyframes store-install-fill {
  from { width: 8%; }
  to { width: 100%; }
}

@keyframes store-install-spin {
  to { transform: rotate(360deg); }
}

.store-card-cover {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.store-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.store-card-icon {
  flex: 0 0 auto;
  border-radius: 8px;
}

.store-card-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.store-card-badge.is-cloud {
  background: rgba(30, 136, 229, 0.22);
  color: #7db4ff;
}

.store-card-badge.is-local {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
}

.store-card-main {
  flex: 1 1 auto;
  min-width: 0;
}

.store-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.store-card-name {
  font-weight: 600;
  font-size: 15px;
}

.store-card-price {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(21, 101, 192, 0.25);
  color: #7db4ff;
  white-space: nowrap;
}

.store-card-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-card-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.store-card-note.is-warn {
  color: #ffb84d;
}

.store-card-note.is-trial {
  color: #8bc98f;
}

.store-card-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(42vw, 200px);
}

/* Bottoni azione — tema scuro Store (docs-btn altrimenti resta grigio chiaro) */
.store-card-actions .docs-btn {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.store-card-actions .docs-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.24);
}

.store-card-actions .docs-btn:active {
  transform: translateY(1px);
}

.store-card-actions .docs-btn.primary {
  background: linear-gradient(180deg, #1e88e5 0%, #1565c0 100%);
  border-color: rgba(100, 181, 246, 0.45);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 2px 8px rgba(21, 101, 192, 0.35);
}

.store-card-actions .docs-btn.primary:hover {
  background: linear-gradient(180deg, #42a5f5 0%, #1976d2 100%);
  border-color: rgba(144, 202, 249, 0.55);
}

.store-card-actions .docs-btn[data-danger="1"] {
  background: rgba(198, 40, 40, 0.14);
  border-color: rgba(239, 83, 80, 0.4);
  color: #ff8a80;
  box-shadow: none;
}

.store-card-actions .docs-btn[data-danger="1"]:hover {
  background: rgba(198, 40, 40, 0.26);
  border-color: rgba(255, 138, 128, 0.55);
  color: #ffab91;
}

.store-card-actions .docs-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* Voci moduli nel menu Start */
.start-app-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.start-app-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.start-app-item img {
  border-radius: 6px;
}
