/* MineStudio Web Stylesheet */
:root {
  --bg-dark: #121118;
  --bg-card: #1A1822;
  --bg-card-hover: #22202D;
  --bg-surface: #1E1C27;
  --border-light: #444152;
  --border-dark: #0A090E;
  --border-black: #050508;
  --grass-green: #3B8526;
  --grass-green-light: #55AA33;
  --grass-green-dark: #2C641D;
  --gold-yellow: #FFAA00;
  --gold-light: #FFD455;
  --diamond-cyan: #55FFFF;
  --text-main: #FFFFFF;
  --text-dim: #A6A4B2;
  --text-muted: #6E6D7A;
  --mc-bevel: inset 2px 2px 0px rgba(255, 255, 255, 0.08), inset -2px -2px 0px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg-dark); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; }
.header { background: #171520; border-bottom: 2px solid var(--border-black); box-shadow: 0 4px 12px rgba(0,0,0,0.5); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.logo-group { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); }
.logo-img { width: 36px; height: 36px; border-radius: 4px; }
.logo-title { font-size: 1.25rem; font-weight: 800; text-shadow: 1px 1px 0 #000; }
.logo-title span { color: var(--gold-yellow); }
.version-tag { background: #2B2836; border: 1px solid var(--border-light); color: var(--gold-light); font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.tabs { display: flex; gap: 6px; background: #100F15; padding: 4px; border-radius: 6px; border: 1px solid #2A2833; }
.tab-btn { background: transparent; color: var(--text-dim); border: none; padding: 8px 14px; font-size: 0.85rem; font-weight: 700; border-radius: 4px; cursor: pointer; }
.tab-btn:hover { color: #FFF; background: rgba(255,255,255,0.05); }
.tab-btn.active { background: var(--grass-green); color: #FFF; box-shadow: var(--mc-bevel); text-shadow: 1px 1px 0 rgba(0,0,0,0.6); }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; flex: 1; width: 100%; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.search-box { position: relative; }
.search-input { width: 100%; background: #1B1924; border: 2px solid var(--border-black); color: #FFF; padding: 12px 40px 12px 14px; border-radius: 4px; font-size: 0.95rem; outline: none; }
.search-input:focus { border-color: var(--grass-green-light); }
.clear-search-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; display: none; }
.categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-chip { background: #1E1C27; border: 1px solid #333140; color: var(--text-dim); padding: 6px 14px; font-size: 0.8rem; font-weight: 700; border-radius: 20px; cursor: pointer; white-space: nowrap; }
.cat-chip:hover { color: #FFF; border-color: var(--gold-yellow); }
.cat-chip.active { background: var(--gold-yellow); color: #111; border-color: var(--gold-light); font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--bg-card); border: 2px solid var(--border-black); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.12s, border-color 0.12s; box-shadow: 0 4px 10px rgba(0,0,0,0.4); cursor: pointer; }
.card:hover { transform: translateY(-2px); border-color: var(--border-light); background: var(--bg-card-hover); }
.card-banner { width: 100%; height: 160px; background: #252330; position: relative; overflow: hidden; }
.card-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-world { background: #A83232; color: #FFF; }
.badge-addon { background: #2574A9; color: #FFF; }
.badge-pack { background: #16A085; color: #FFF; }
.badge-bedrock { background: rgba(18, 17, 24, 0.85); color: var(--grass-green-light); border: 1px solid rgba(85, 170, 51, 0.4); }
.card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: #FFF; line-height: 1.25; }
.card-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.05); }
.card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.rating { color: var(--gold-yellow); font-weight: 700; }
.mc-btn { background: var(--grass-green); color: #FFF; border: 2px solid var(--border-black); box-shadow: var(--mc-bevel); padding: 8px 14px; font-size: 0.85rem; font-weight: 800; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-shadow: 1px 1px 0 #1B4510; }
.mc-btn:hover { background: var(--grass-green-light); }
.mc-btn:active { background: var(--grass-green-dark); }
.mc-btn-sm { padding: 6px 10px; font-size: 0.75rem; }
.mc-btn-gold { background: #D48800; color: #FFF; text-shadow: 1px 1px 0 #5E3C00; }
.mc-btn-gold:hover { background: #FFAA00; }
.skin-card { background: var(--bg-card); border: 2px solid var(--border-black); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.skin-preview { width: 120px; height: 140px; background: #14131B; border: 1px solid #2B2936; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; padding: 8px; }
.skin-preview img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.skin-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-author { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.skin-actions { display: flex; gap: 6px; width: 100%; }
.skin-actions .mc-btn { flex: 1; }
.state-box { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-dim); }
.spinner { width: 36px; height: 36px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--grass-green-light); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { margin-top: 24px; display: flex; justify-content: center; gap: 12px; align-items: center; }
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.active { display: flex; }
.modal { background: #1A1823; border: 3px solid var(--border-black); box-shadow: 0 10px 30px rgba(0,0,0,0.8), var(--mc-bevel); border-radius: 6px; max-width: 680px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 14px 18px; background: #221F2D; border-bottom: 2px solid var(--border-black); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.15rem; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: #FFF; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-banner { width: 100%; height: 220px; background: #100F15; border: 1px solid #2B2936; border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.modal-banner img { width: 100%; height: 100%; object-fit: cover; }
.modal-section-title { font-size: 0.85rem; font-weight: 800; color: var(--gold-yellow); text-transform: uppercase; margin: 14px 0 6px; }
.modal-desc { font-size: 0.88rem; line-height: 1.5; color: var(--text-dim); white-space: pre-line; }
.instructions-box { background: #14131B; border: 1px solid #2A2835; border-left: 4px solid var(--grass-green); padding: 12px; border-radius: 4px; margin-top: 12px; font-size: 0.82rem; line-height: 1.5; color: #CCC; }
.modal-footer { padding: 14px 18px; background: #171520; border-top: 2px solid var(--border-black); display: flex; justify-content: flex-end; gap: 10px; }
.app-info-card { background: var(--bg-card); border: 2px solid var(--border-black); border-radius: 6px; padding: 24px; max-width: 720px; margin: 0 auto; box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
.app-info-card h2 { font-size: 1.4rem; margin-bottom: 12px; color: var(--gold-yellow); }
.app-info-card p { color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; font-size: 0.95rem; }
.step-list { margin-left: 20px; margin-bottom: 20px; color: var(--text-dim); line-height: 1.6; }
.step-list li { margin-bottom: 8px; }
.step-list strong { color: var(--text-main); }

/* Disabled states */
.mc-btn:disabled, button:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.7) !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

/* Button spinner */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Download Status Banner inside modal */
.dl-status-box {
  background: #111A10;
  border: 1px solid var(--grass-green-light);
  border-left: 4px solid var(--grass-green-light);
  padding: 12px;
  border-radius: 4px;
  margin-top: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #B3F5A8;
  display: none;
}
.dl-status-box.active {
  display: block;
}

/* Floating Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1C1A27;
  border: 2px solid var(--grass-green-light);
  color: #FFF;
  padding: 14px 24px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), var(--mc-bevel);
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 2000;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
