/* ================================================================
   Minecius — Install modal styles (v4.8)
   4 tabs with SVG icons, collapsibles, in site theme
   ================================================================ */

/* ============ TABS ============ */
.modal-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  background: var(--bg);
  border-radius: 12px;
  margin: 0 24px 20px;
  border: 1px solid var(--border);
}

.modal-tab {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 8px !important;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}
.modal-tab:hover:not(.active) {
  color: var(--text);
  background: var(--card);
}
.modal-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.modal-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-tab-icon svg {
  width: 15px;
  height: 15px;
}

/* ============ DOWNLOAD BLOCK (FILE TAB) ============ */
.download-block {
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(185, 28, 28, 0.08));
  border: 1px solid var(--border-hover);
  border-radius: 14px;
}

.btn-xl {
  padding: 16px 28px !important;
  font-size: 15px !important;
  font-weight: 700;
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.download-main-btn {
  margin-bottom: 8px;
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.35);
  transition: all 0.25s;
}
.download-main-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 107, 107, 0.5);
}
.download-main-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.dl-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dl-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Notice */
.modal-notice {
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(16, 216, 118, 0.1);
  border: 1px solid rgba(16, 216, 118, 0.3);
  color: #10d876;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}
.modal-notice.visible {
  opacity: 1;
  max-height: 60px;
  padding: 10px 14px;
  margin: 12px 0;
}
.modal-notice.error {
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.3);
  color: #ff5c5c;
}

/* Password block */
.password-block {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.password-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.password-label svg { width: 14px; height: 14px; }

.password-input-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
  position: relative;
  flex-wrap: wrap;
}

.password-input {
  flex: 1;
  min-width: 180px;
  padding: 12px 44px 12px 16px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}
.password-input:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}

.password-toggle-btn {
  position: absolute;
  right: 148px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn:hover {
  background: var(--card);
  color: var(--brand-1);
}
.password-toggle-btn svg { width: 16px; height: 16px; }

.password-copy-btn {
  padding: 12px 18px !important;
  font-size: 13px !important;
  font-weight: 600;
  min-width: 130px;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.password-copy-btn svg { width: 14px; height: 14px; }
.password-copy-btn.copied {
  background: linear-gradient(135deg, #10d876 0%, #059669 100%);
  box-shadow: 0 6px 18px rgba(16, 216, 118, 0.35);
}

.password-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.password-hint svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ============ COPY SCRIPT BUTTON ============ */
.copy-btn.copied {
  background: linear-gradient(135deg, #10d876 0%, #059669 100%) !important;
  color: white !important;
  border-color: transparent !important;
}

/* ============ COLLAPSIBLES ============ */
.collapse-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
}
.collapse-section:last-child { margin-bottom: 0; }
.collapse-section.expanded {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.collapse-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  transition: background 0.15s;
}
.collapse-header:hover { background: var(--bg); }

.collapse-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--grad-soft);
  border: 1px solid var(--border-hover);
  color: var(--brand-1);
}
.collapse-icon svg { width: 16px; height: 16px; }

.collapse-title { flex: 1; }

.collapse-arrow {
  color: var(--text-mute);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  display: flex;
}
.collapse-arrow svg { width: 16px; height: 16px; }
.collapse-section.expanded .collapse-arrow {
  transform: rotate(180deg);
  color: var(--brand-1);
}

.collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.collapse-section.expanded .collapse-body {
  max-height: 2000px;
}

/* ============ INSTRUCTION LIST ============ */
.instruction-list {
  list-style: none;
  padding: 4px 18px 18px !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.instruction-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.instruction-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--grad);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.25);
}

.instruction-list h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}

.instruction-list p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.instruction-list code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--brand-1);
  border: 1px solid var(--border);
}

.instruction-list kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border-strong);
  line-height: 1;
}

/* ============ VIDEO ============ */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin: 4px 18px 10px;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  text-align: center;
  padding: 20px;
}
.video-placeholder-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  opacity: 0.5;
  color: var(--text-mute);
}
.video-placeholder-icon svg {
  width: 100%;
  height: 100%;
}
.video-placeholder p {
  font-size: 13px;
  color: var(--text-mute);
  margin: 0;
}

/* Note under video */
.collapse-body .script-note {
  margin: 0 18px 18px;
}

/* ============ SCRIPT-NOTE FIX (SVG in text) ============ */
.script-note {
  display: flex;
  align-items: center;
  gap: 6px;
}
.script-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Script header ("PowerShell" label with icon) */
.script-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.script-lang svg { width: 14px; height: 14px; }

/* ============ MOBILE ============ */
@media (max-width: 700px) {
  .modal-tabs {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 16px 16px;
  }
  .modal-tab {
    padding: 9px 6px !important;
    font-size: 12px;
    gap: 6px;
  }
  .modal-tab-icon svg { width: 14px; height: 14px; }
}

@media (max-width: 600px) {
  .download-block { padding: 18px; }
  .btn-xl { padding: 14px 20px !important; font-size: 14px !important; }
  .password-input-wrap { flex-direction: column; }
  .password-input {
    width: 100%;
    padding-right: 44px;
    min-width: 0;
  }
  .password-copy-btn {
    width: 100%;
    min-width: 0;
  }
  .password-toggle-btn {
    right: 8px;
    top: 22px;
    transform: none;
  }
  .collapse-header {
    padding: 14px;
    font-size: 13px;
    gap: 10px;
  }
  .collapse-icon {
    width: 28px;
    height: 28px;
  }
  .collapse-icon svg { width: 14px; height: 14px; }
  .instruction-list { gap: 12px; padding: 4px 14px 14px !important; }
  .instruction-num {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .video-wrapper, .collapse-body .script-note { margin-left: 14px; margin-right: 14px; }
}
