/* ================================================================
   CGWALLS — Wallpaper Modal
   ================================================================ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(5,5,8,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--tb) var(--ease);
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-2xl);
  width: fit-content; max-width: 95vw;
  max-height: 90vh;
  display: flex; overflow: hidden;
  box-shadow: var(--sh-lg), 0 0 80px rgba(0,0,0,.6);
  transform: scale(.95); transition: transform var(--tb) var(--ease);
}
.modal-overlay.open .modal-box { transform: scale(1); }

/* ── image side ── */
.modal-img-wrap {
  position: relative;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
}
.modal-box--phone .modal-img-wrap,
.modal-box--both .modal-img-wrap {
  height: 85vh; max-height: 800px;
  aspect-ratio: 9/16;
}
.modal-box--desktop .modal-img-wrap {
  width: 60vw; max-width: 850px;
  aspect-ratio: 16/9;
}
.modal-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.modal-nav {
  position: absolute; top: 50%; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 12px;
  transform: translateY(-50%); pointer-events: none;
}
.modal-nav-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(10,10,13,.75); backdrop-filter: blur(8px);
  border: 1px solid var(--border-hi); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; pointer-events: all;
  transition: background var(--tf) var(--ease), border-color var(--tf) var(--ease), color var(--tf) var(--ease);
}
.modal-nav-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.modal-nav-btn svg { width: 16px; height: 16px; }

/* ── info side ── */
.modal-info {
  flex: 0 0 340px;
  display: flex; flex-direction: column;
  padding: 32px 28px 28px;
  overflow-y: auto;
  gap: 6px;
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border-hi);
  color: var(--text2); z-index: 10;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--tf) var(--ease), color var(--tf) var(--ease), border-color var(--tf) var(--ease);
}
.modal-close:hover { background: rgba(255,80,80,.15); color: #ff5050; border-color: rgba(255,80,80,.4); }
.modal-close svg { width: 16px; height: 16px; }

.modal-cat-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; font-family: 'Space Mono', monospace;
  padding: 4px 12px; border-radius: var(--r-full);
  margin-bottom: 10px; width: fit-content;
}
.modal-cat-badge.cat-phone   { background: var(--cyan-dim);   color: var(--cyan);   }
.modal-cat-badge.cat-desktop { background: var(--purple-dim); color: var(--purple); }
.modal-cat-badge.cat-both    { background: var(--accent-dim); color: var(--accent); }

.modal-name {
  font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--text);
}
.modal-artist {
  font-size: 13px; color: var(--muted); font-family: 'Space Mono', monospace; margin-top: 4px;
}

.modal-meta-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.modal-meta-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0;
}
.modal-meta-icon svg { width: 14px; height: 14px; }
.modal-meta-text { font-size: 12px; color: var(--text2); font-family: 'Space Mono', monospace; }

.modal-tags-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  font-family: 'Space Mono', monospace; margin-top: 12px;
}
.modal-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.modal-tag {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 4px 12px;
  font-size: 11px; color: var(--text2); font-family: 'Space Mono', monospace;
  cursor: default;
}

.modal-actions {
  margin-top: auto; padding-top: 20px;
  display: flex; flex-direction: column; gap: 10px;
}

.modal-download-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); border: none; border-radius: var(--r-md);
  padding: 13px; font-size: 13px; font-weight: 700;
  font-family: 'Space Mono', monospace; color: #0a0a0d; cursor: pointer;
  transition: background var(--tf) var(--ease), transform var(--tf) var(--ease), box-shadow var(--tf) var(--ease);
}
.modal-download-btn:hover {
  background: #eeeeee; transform: translateY(-1px); box-shadow: var(--accent-glow);
}
.modal-download-btn svg { width: 16px; height: 16px; }

.modal-copy-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface2); border: 1.5px solid var(--border-hi);
  border-radius: var(--r-md); padding: 11px;
  font-size: 12px; font-weight: 700; font-family: 'Space Mono', monospace;
  color: var(--text2); cursor: pointer;
  transition: background var(--tf) var(--ease), border-color var(--tf) var(--ease), color var(--tf) var(--ease);
}
.modal-copy-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.modal-copy-btn svg { width: 14px; height: 14px; }

/* ── mobile ── */
@media (max-width: 700px) {
  .modal-box      { flex-direction: column; width: 100%; max-height: 95vh; }
  .modal-img-wrap { 
    width: 100% !important; height: auto !important; max-height: 45vh !important; 
    aspect-ratio: auto !important; 
  }
  .modal-info     { flex: 1 1 auto; padding: 22px 20px 20px; }
  .modal-name     { font-size: 20px; }
}
