@import url('https://ffcl.vercel.app/resource?id=fonts');

:root {
  --bg:               #000;
  --text:             #fff;
  --card-bg:          #111;
  --card-border:      #888;
  --card-hover-border:#333;
  --modal-bg:         rgba(0,0,0,0.85);
  --btn-active-bg:    #fff;
  --btn-active-text:  #000;
  --font:             'GFF ShahGCreator', sans-serif;
  --speed:            0.2s;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0; padding: 0;
  overflow-x: hidden;
}

::selection { background: #1e1e1e; color: var(--text); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.header {
  width: 100%;
  padding: 1rem 1rem 0rem;
  background: rgba(0,0,0,0.9);
  text-align: center;
}

.header-title {
  font-size: 2rem; font-weight: bold;
  color: var(--text); margin: 0;
  padding-bottom: 0.5rem;
}

.container {
  padding: 1rem; max-width: 1200px;
  margin: 0 auto; text-align: center;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 1rem; padding: 0.4rem 1rem 0.5rem;
}

/* ── Icon Card ────────────────────────────────────────────────────────────── */
.icon-card {
  background: var(--card-bg);
  padding: 0.1rem;
  cursor: pointer; user-select: none;
  border: 1px solid var(--card-border);
  border-radius: 0.425rem;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  will-change: transform;
  transition: transform var(--speed) ease, border-color var(--speed) ease;
}
.icon-card:hover  { border-color: var(--card-hover-border); transform: scale(1.05); }
.icon-card:active { transform: scale(0.96); }
.icon-card.dev-selected {
  border-color: #34c759;
  box-shadow: 0 0 0 2px rgba(52,199,89,0.35);
}

.img-wrap { position: relative; width: 100%; height: 100%; }
.img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 5px; object-fit: contain;
  animation: iconLoad 0.4s ease-in-out;
}
@keyframes iconLoad {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.img-shimmer { position: absolute; inset: 0; border-radius: 5px; z-index: 1; }

/* ── Skeleton ─────────────────────────────────────────────────────────────── */
.icon-card.skeleton { pointer-events: none; border-color: #1e1e1e; }
.skeleton-img { width: 100%; height: 100%; border-radius: 5px; }

/* ── Shimmer ──────────────────────────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, #1a1a1a 0%, #2e2e2e 40%, #1a1a1a 80%);
  background-size: 300% 100%;
  animation: shimmerMove 1.6s ease-in-out infinite;
}
@keyframes shimmerMove {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination-container { margin-top: 0.75rem; display: flex; justify-content: center; }

.pagination {
  display: flex; overflow-x: auto; white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--card-border);
  padding: 0.2rem 0.35rem;
  border-radius: 0.9375rem;
  max-width: 90%; margin-left: 15px;
  scrollbar-width: none;
}
.pagination::-webkit-scrollbar { display: none; }

.pagination button {
  padding: 0.28rem 0.5rem;
  margin: 0.08rem;
  border: none; background: transparent;
  color: var(--text); cursor: pointer;
  border-radius: 0.3rem;
  font-size: 0.88rem; font-family: var(--font);
  transition: background var(--speed), color var(--speed);
  line-height: 1.4;
}
.pagination button:hover  { border: 1px solid #222; }
.pagination button.active { background: var(--btn-active-bg); color: var(--btn-active-text); }

/* ── Modal Overlay ────────────────────────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  animation: fadeIn var(--speed) ease;
}
.modal.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal Card ───────────────────────────────────────────────────────────── */
.modal-content {
  background: rgba(10,10,10,0.78);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  color: var(--text);
  max-width: 360px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  animation: modalPop 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
  scrollbar-width: none;
}
.modal-content::-webkit-scrollbar { display: none; }
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.87) translateY(18px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-img-wrap {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 1.5rem 1.5rem 0 0;
}
.modal-img-shimmer { position: absolute; width: 200px; height: 200px; border-radius: 1rem; }
#modalImage {
  position: relative; z-index: 1;
  width: 200px; height: 200px;
  object-fit: contain; border-radius: 0.75rem;
  user-select: none; transition: opacity 0.25s ease;
}
#modalImage.loading { opacity: 0; }

/* ── Modal Info — Name centered, rows LEFT aligned ────────────────────────── */
.modal-info { width: 100%; padding: 0.875rem 1.25rem 0.4rem; }

.modal-item-name {
  font-size: 1.05rem; font-weight: bold;
  color: #fff; text-align: center;
  word-break: break-word; line-height: 1.35;
  margin-bottom: 0.1rem;
}

.modal-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0.5rem 0; }

/* Each row: label on the left, value after */
.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
  text-align: left;
}

.modal-label {
  color: #ff5555;
  font-weight: bold;
  flex-shrink: 0;
  font-size: 0.82rem;
  padding-top: 0.02rem;
  white-space: nowrap;
  margin-right: 0.3rem;
}

.modal-value { color: #33cc66; flex: 1; }

.modal-value-wrap {
  display: flex; align-items: center;
  gap: 0.4rem; flex: 1; flex-wrap: wrap;
}

/* ── Copy Button ──────────────────────────────────────────────────────────── */
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.18rem 0.3rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #aaa; border-radius: 0.3rem; cursor: pointer;
  flex-shrink: 0; line-height: 1;
  transition: background var(--speed), color var(--speed);
}
.copy-btn:hover  { background: rgba(255,255,255,0.14); color: #fff; }
.copy-btn.copied { background: rgba(50,200,100,0.18); color: #33cc66; border-color: rgba(50,200,100,0.4); }

/* ── Modal Actions ────────────────────────────────────────────────────────── */
.modal-actions {
  display: flex; gap: 0.5rem;
  padding: 0.4rem 1.25rem 1.1rem;
  width: 100%;
}

.modal-share-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #aaa; font-family: var(--font); font-size: 0.82rem;
  cursor: pointer; border-radius: 3.125rem;
  transition: background var(--speed), color var(--speed);
  white-space: nowrap;
}
.modal-share-btn:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.modal-share-btn.copied { background: rgba(50,200,100,0.15); color: #33cc66; }

.modal-close {
  flex: 1; padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #aaa; font-family: var(--font); font-size: 0.85rem;
  cursor: pointer; border-radius: 3.125rem;
  transition: background var(--speed), color var(--speed); text-align: center;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Search — original single-line, NO new line on Enter ─────────────────── */
.input-container {
  margin-top: 0.5rem; width: 100%;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.search-container {
  position: relative; display: flex; align-items: center;
  width: 75%; max-width: 450px; margin: 0 auto;
}

.search-icon {
  position: absolute; right: 0.85rem; top: 50%;
  transform: translateY(-50%);
  width: 1.3rem; height: 1.3rem;
  pointer-events: none; fill: #fff;
}

textarea#search {
  width: 100%;
  padding: 0 2.8rem 0 1rem;
  border-radius: 15px;
  border: 1px solid var(--card-border);
  background: #1a1a1a; color: var(--text);
  font-family: var(--font); font-size: 0.9rem;
  resize: none;
  height: 2.35rem;
  line-height: 2.35rem;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
textarea#search::placeholder { color: #aaa; font-style: normal; }
textarea#search:focus {
  outline: none; border-color: #888; background: #2a2a2a;
  box-shadow: 0 0 8px rgba(255,255,255,0.15);
}

.filter-container {
  display: flex; gap: 0.5rem;
  width: 75%; max-width: 450px;
  margin: 0 auto; flex-wrap: nowrap; justify-content: center;
}

select {
  flex: 1; min-width: 80px; max-width: 150px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: 5px;
  background: #1a1a1a; color: var(--text);
  border: 1px solid #444; font-size: 0.9rem;
  transition: all 0.3s ease;
  appearance: none; -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23aaa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-position: right 0.75rem center; background-repeat: no-repeat;
}
select:focus { outline: none; border-color: #888; background-color: #2a2a2a; }
select option { background: #1a1a1a; color: var(--text); font-family: var(--font); font-size: 0.9rem; }

/* ── Dev Copy Button ──────────────────────────────────────────────────────── */
.dev-copy-btn {
  display: none; align-items: center; justify-content: center; gap: 0.4rem;
  margin: 0.75rem auto 0; padding: 0.5rem 1.25rem;
  background: rgba(255,200,0,0.1); border: 1px solid rgba(255,200,0,0.3);
  color: #ffcc00; font-family: var(--font); font-size: 0.82rem;
  cursor: pointer; border-radius: 3.125rem;
  transition: background var(--speed), color var(--speed);
}
.dev-copy-btn:hover  { background: rgba(255,200,0,0.2); color: #ffe066; }
.dev-copy-btn.copied { background: rgba(50,200,100,0.15); color: #33cc66; }
.dev-copy-btn.show   { display: inline-flex; }

/* ── No Items — centered ──────────────────────────────────────────────────── */
.no-items {
  margin: 48px 48px;
  background: #0d0d0d; border: 1px solid #1e1e1e;
  border-radius: 1.25rem; padding: 2rem 1.5rem 1.5rem;
  text-align: center; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  grid-column: 1 / -1;
  justify-self: center;
  animation: noItemsIn 0.4s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes noItemsIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.no-items-icon { font-size: 2.8rem; line-height: 1; margin-bottom: 0.25rem; }
.no-items h2 {
  font-size: 1.2rem; font-weight: bold; color: #fff;
  margin: 0; text-transform: uppercase; letter-spacing: 0.06em;
}
.no-items .sub { font-size: 0.82rem; color: #666; margin: 0; }
.no-items .divider { width: 40px; height: 1px; background: #222; margin: 0.25rem auto; }
.no-items .connect-text { font-size: 0.78rem; color: #fff; margin: 0; }

.no-items .social-links {
  display: flex; justify-content: center;
  gap: 1rem; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; margin-top: 0.35rem;
}
.no-items .social-links::-webkit-scrollbar { display: none; }
.no-items .social-links a {
  text-decoration: none; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  width: 56px; font-size: 0.7rem;
  transition: transform 0.25s;
}
.no-items .social-links a:hover { transform: translateY(-3px); }
.no-items .social-links img { width: 30px; height: 30px; filter: none; }
.no-items .footer { font-size: 0.65rem; color: #fff; margin-top: 0.5rem; }

/* ── FAB Settings — only wheel, no box ───────────────────────────────────── */
.fab-settings {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px;
  /* transparent background, no border, no box */
  background: transparent;
  border: none;
  color: #fff; opacity: 0.75;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 900;
  transition: opacity 0.25s ease;
  touch-action: none;
  /* subtle drop shadow on the icon itself */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}
.fab-settings:hover { opacity: 1; }
.fab-settings.spinning svg { animation: spinGear 0.45s ease forwards; }
@keyframes spinGear { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }

/* ── Settings Overlay ─────────────────────────────────────────────────────── */
.settings-overlay {
  display: none;
  position: fixed; inset: 0;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
}
.settings-overlay.open {
  display: flex;
}
.settings-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Settings Panel ───────────────────────────────────────────────────────── */
.settings-panel {
  background: #111; border: 1px solid #222;
  border-radius: 1.5rem 1.5rem 0 0;
  width: 100%; max-width: 480px;
  padding: 0 0 1.5rem;
  /* animation: slideUpPanel 0.3s cubic-bezier(0.34,1.3,0.64,1) both; */
  max-height: 85vh; overflow-y: auto; scrollbar-width: none;
}
.settings-panel::-webkit-scrollbar { display: none; }
@keyframes slideUpPanel {
  from { transform: translateY(40px); }
  to   { transform: translateY(0); }
}

.settings-handle {
  width: 40px; height: 4px; background: #333;
  border-radius: 2px; margin: 0.75rem auto 0;
}

.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem 0.5rem;
}
.settings-title { font-size: 1rem; font-weight: bold; color: #fff; }
.settings-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #888; border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.settings-close-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1.25rem; gap: 1rem;
}
.settings-row-btn { cursor: pointer; }
.settings-row-btn:hover { background: rgba(255,255,255,0.03); }
.settings-row-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.settings-row-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  color: #888; flex-shrink: 0;
}
.settings-row-text { display: flex; flex-direction: column; gap: 0.1rem; }
.settings-row-label { font-size: 0.9rem; color: #fff; font-weight: 500; }
.settings-row-sub   { font-size: 0.72rem; color: #666; }
.settings-row-action { color: #555; display: flex; align-items: center; flex-shrink: 0; }
.settings-row-action.copied { color: #33cc66; }

/* ── iOS Toggle ───────────────────────────────────────────────────────────── */
.ios-toggle { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.ios-toggle input { display: none; }
.ios-toggle-track {
  width: 51px; height: 31px; background: #3a3a3a;
  border-radius: 31px; transition: background 0.3s ease;
  display: block; position: relative;
}
.ios-toggle input:checked + .ios-toggle-track { background: #34c759; }
.ios-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; background: #fff;
  border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.ios-toggle input:checked + .ios-toggle-track .ios-toggle-thumb { transform: translateX(20px); }

.settings-divider { height: 1px; background: #1e1e1e; margin: 0.25rem 0; }
.settings-section-label {
  padding: 0.75rem 1.25rem 0.4rem;
  font-size: 0.72rem; color: #555;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Settings Social Links — full color, white text ──────────────────────── */
.settings-socials {
  display: flex; gap: 0.75rem; padding: 0 1.25rem; justify-content: center;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
}
.settings-socials::-webkit-scrollbar { display: none; }
.settings-social-link {
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.75rem; padding: 0.6rem 0.75rem;
  min-width: 62px; flex-shrink: 0;
  color: #fff; font-size: 0.7rem;
  transition: background var(--speed), transform var(--speed);
}
.settings-social-link img { width: 26px; height: 26px; filter: none; }
.settings-social-link:hover { background: rgba(255,255,255,0.09); transform: translateY(-2px); }

.settings-footer {
  text-align: center; padding: 1rem 1.25rem 0;
  font-size: 0.65rem; color: #fff;
}

/* ── Loading Spinner ──────────────────────────────────────────────────────── */
.loading-spinner {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%); z-index: 1000;
}
.spinner {
  border: 4px solid #121212; border-radius: 50%;
  border-top: 4px solid #fff;
  width: 1.5rem; height: 1.5rem;
  animation: spin 0.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading Overlay ──────────────────────────────────────────────────────── */
#loadingOverlay {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  background: url('/Items/bg.png') no-repeat center center / cover;
  z-index: 9999; display: flex; flex-direction: column;
  justify-content: flex-end; overflow: hidden;
}
/* Desktop screens */
@media screen and (min-width: 1024px) {
  #loadingOverlay {
    background: url('/Items/bg-1.png') no-repeat center center / cover;
  }
}
.loading-bar-wrapper {
  background: rgba(0,0,0,0.8); padding: 0.75rem; width: 100%;
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.loading-bar-container {
  flex: 1; max-width: 85%; height: 0.875rem;
  background: #222; border-radius: 10px; overflow: hidden; position: relative;
}
.loading-bar {
  height: 100%; width: 0%;
  background: linear-gradient(270deg, #00d2ff, #0050ff, #00d2ff);
  background-size: 400% 400%;
  animation: barAnim 2s infinite;
  box-shadow: 0 0 8px #00aaff;
  transition: width 0.2s ease; border-radius: 10px;
}
.loading-bar::after {
  content: ""; position: absolute; top: 0; left: -40%;
  width: 40%; height: 100%; background: rgba(255,255,255,0.3);
  transform: skewX(-20deg); animation: shine 2s infinite;
}
.loading-percentage {
  color: #00aaff; font-weight: bold; font-size: 0.875rem;
  margin-left: 0.625rem; min-width: 40px; text-align: right;
}
@keyframes barAnim { 0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%} }
@keyframes shine { 0%{left:-40%}50%{left:100%}100%{left:100%} }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-title { font-size: 1.75rem; }
  .search-container { width: 85%; }
  .modal-content { max-width: 88%; }
  #modalImage, .modal-img-shimmer { width: 160px; height: 160px; }
  .modal-img-wrap { padding: 1.5rem 1rem 1rem; }
}

@media (max-width: 480px) {
  .header-title { font-size: 1.5rem; }
  .grid-container { gap: 0.5rem; }
  .modal-content { max-width: 93%; border-radius: 1.25rem; }
  .modal-img-wrap { border-radius: 1.25rem 1.25rem 0 0; padding: 1.25rem 1rem 0.875rem; }
  #modalImage, .modal-img-shimmer { width: 130px; height: 130px; }
  .modal-info { padding: 0.75rem 1rem 0.25rem; }
  .modal-actions { padding: 0.35rem 1rem 1rem; }
  .pagination button { padding: 0.22rem 0.4rem; font-size: 0.82rem; }
  textarea#search { height: 2.35rem; line-height: 2.35rem; padding-right: 2.5rem; }
  .search-icon { width: 1.2rem; height: 1.2rem; }
  .filter-container { gap: 0.3rem; width: 85%; }
  select { min-width: 70px; max-width: 120px; font-size: 0.8rem; padding: 0.4rem 1.5rem 0.4rem 0.5rem; }
  .settings-panel { border-radius: 1.25rem 1.25rem 0 0; }
  .fab-settings { bottom: 1rem; right: 1rem; }
}
