/*
 * Section Work — App Icon Carousel & Detail Popup
 * Styles for _section_work.html.erb (Layanan / Portal Aplikasi)
 */

/* ── App icon tile (iOS-launcher style) ──────────────────────────────────── */
.app-icon-tile {
  flex: 0 0 120px;
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 4px 0 2px;
  border-radius: 10px;
  transition: transform .2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.app-icon-tile:hover { transform: translateY(-5px); }

.app-icon-tile .ait-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: box-shadow .2s ease, transform .2s ease;
  position: relative;
}
.app-icon-tile:hover .ait-icon {
  box-shadow: 0 0 0 3px rgba(35,178,238,.55), 0 8px 24px rgba(0,0,0,.4);
  transform: scale(1.07);
}
.ait-icon.has-logo {
  background: linear-gradient(145deg, rgba(35,178,238,.55) 0%, rgba(10,65,180,.75) 100%);
}
.app-icon-tile .ait-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  background: transparent;
}
.app-icon-tile .ait-icon .ait-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.app-icon-tile .ait-name {
  font-size: 11px;
  font-weight: 600;
  color: #d8d8d8;
  line-height: 1.35;
  max-width: 108px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color .2s;
}
.app-icon-tile:hover .ait-name { color: #23B2EE; }

.light-version .app-icon-tile .ait-name { color: #333; }
.light-version .app-icon-tile:hover .ait-name { color: #23B2EE; }
.light-version .app-icon-tile .ait-icon { box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ── Viewport headroom for hover-zoom ───────────────────────────────────── */
/* padding-top gives space above track; overflow:hidden clips at border-box  */
/* so icons entering the padding area on translateY/scale are still visible. */
#svc-viewport {
  padding-top: 20px;
  margin-top: -20px;
  cursor: grab;
}
#svc-viewport:active { cursor: grabbing; }

/* ── List-all button ─────────────────────────────────────────────────────── */
.app-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #515151;
  background: transparent;
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.app-list-btn:hover { background: #23B2EE; border-color: #23B2EE; color: #fff; }
.light-version .app-list-btn { border-color: #ccc; color: #555; }
.light-version .app-list-btn:hover { background: #23B2EE; border-color: #23B2EE; color: #fff; }

/* ── App List Popup ──────────────────────────────────────────────────────── */
#app-list-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99989;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}
#app-list-overlay.is-open { display: flex; }

#app-list-popup {
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  cursor: default;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: appPopIn .28s cubic-bezier(.34,1.56,.64,1) both;
  overflow: hidden;
}
.light-version #app-list-popup {
  background: #fff;
  border-color: #e8e8e8;
}

.alp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}
.light-version .alp-header { border-bottom-color: #eee; }

.alp-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
.light-version .alp-title { color: #111; }

#app-list-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  color: #aaa;
  cursor: pointer;
  transition: background .18s, color .18s;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
#app-list-close:hover { background: rgba(35,178,238,.18); color: #23B2EE; }
.light-version #app-list-close { background: #f0f0f0; color: #666; }

#app-list-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 116px;
  gap: 6px;
  padding: 16px 20px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  align-items: start;
}
#app-list-grid::-webkit-scrollbar { width: 5px; }
#app-list-grid::-webkit-scrollbar-track { background: transparent; }
#app-list-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.alp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  cursor: pointer;
  padding: 10px 4px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  height: 100%;
  transition: background .18s, border-color .18s, transform .18s;
  box-sizing: border-box;
}
.alp-tile:hover {
  background: rgba(35,178,238,.08);
  border-color: rgba(35,178,238,.25);
  transform: translateY(-2px);
}
.light-version .alp-tile:hover { background: rgba(35,178,238,.07); }

.alp-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.alp-icon.has-logo {
  background: linear-gradient(145deg, rgba(35,178,238,.55) 0%, rgba(10,65,180,.75) 100%);
}
.alp-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  background: transparent;
}
.alp-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.alp-name {
  font-size: 10.5px;
  font-weight: 600;
  color: #ccc;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.light-version .alp-name { color: #333; }

@media (max-width: 560px) {
  #app-list-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 106px; }
}
@media (max-width: 400px) {
  #app-list-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Scroller nav buttons (matching team section style) ──────────────────── */
.app-scroller-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #515151;
  cursor: pointer;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, border-color .18s;
  flex-shrink: 0;
}
.app-scroller-nav-btn:hover { background: #23B2EE; border-color: #23B2EE; }
.light-version .app-scroller-nav-btn { border-color: #ccc; color: #333; }
.light-version .app-scroller-nav-btn:hover { background: #23B2EE; border-color: #23B2EE; color: #fff; }

/* ── App Detail Popup ────────────────────────────────────────────────────── */
#app-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}
#app-detail-overlay.is-open { display: flex; }

#app-detail-popup {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 32px;
  position: relative;
  cursor: default;
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
  animation: appPopIn .28s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes appPopIn {
  from { opacity: 0; transform: scale(.88) translateY(14px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.light-version #app-detail-popup {
  background: #fff;
  border-color: #e8e8e8;
  box-shadow: 0 32px 80px rgba(0,0,0,.18);
}

#app-detail-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  color: #aaa;
  cursor: pointer;
  transition: background .18s, color .18s;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
#app-detail-close:hover { background: rgba(35,178,238,.18); color: #23B2EE; }
.light-version #app-detail-close { background: #f0f0f0; color: #666; }
.light-version #app-detail-close:hover { background: rgba(35,178,238,.12); color: #23B2EE; }

#app-detail-popup .popup-icon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  flex-shrink: 0;
}
#app-detail-popup .popup-icon-wrap.has-logo {
  background: linear-gradient(145deg, rgba(35,178,238,.55) 0%, rgba(10,65,180,.75) 100%);
}
#app-detail-popup .popup-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  background: transparent;
}
#app-detail-popup .popup-icon-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

#app-detail-popup .popup-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}
.light-version #app-detail-popup .popup-name { color: #111; }

#app-detail-popup .popup-url {
  font-size: 11px;
  color: #555;
  text-align: center;
  margin-bottom: 16px;
  word-break: break-all;
  font-family: monospace;
}
.light-version #app-detail-popup .popup-url { color: #999; }

#app-detail-popup .popup-divider {
  border: none;
  border-top: 1px solid #2e2e2e;
  margin: 0 0 16px;
}
.light-version #app-detail-popup .popup-divider { border-color: #eee; }

#app-detail-popup .popup-desc {
  font-size: 13.5px;
  color: #9a9a9a;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 22px;
  min-height: 20px;
}
.light-version #app-detail-popup .popup-desc { color: #666; }

#app-detail-popup .popup-access-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: #23B2EE;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: 10px;
  text-decoration: none;
  transition: background .2s, transform .15s;
  border: none;
  cursor: pointer;
}
#app-detail-popup .popup-access-btn:hover {
  background: #14a0d8;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
#app-detail-popup .popup-access-btn svg { flex-shrink: 0; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.app-scroller-empty {
  text-align: center;
  padding: 60px 0 20px;
  color: #555;
  font-size: 14px;
}
