/* ============================================
   Image Store - Styles v2
   ピンク × シアン カワイイテーマ
   ============================================ */

:root {
  --pink: #F7609A;
  --pink-hover: #e05089;
  --pink-light: #FFE8F3;
  --pink-mid: #FFB3D1;
  --cyan: #2EC4C4;
  --cyan-hover: #25aaaa;
  --cyan-light: #E4FAFA;
  --cyan-mid: #7DE8E8;
  --white: #FFFFFF;
  --text: #3A3A3A;
  --text-muted: #999;
  --text-subtle: #bbb;
  --bg: #FDFCFE;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ Blobs (背景デコレーション) ============ */
.blob-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.blob { position: absolute; opacity: 0.12; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 140ms;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--pink); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--pink-hover); }

.btn-cyan { background: var(--cyan); color: var(--white); }
.btn-cyan:hover:not(:disabled) { background: var(--cyan-hover); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--pink-mid);
  color: var(--pink);
}
.btn-outline:hover:not(:disabled) { background: var(--pink-light); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid #e8e8e8;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) { background: #f6f6f6; color: var(--text); }

.btn-danger {
  background: transparent;
  border: 1.5px solid var(--pink-mid);
  color: var(--pink);
}
.btn-danger:hover:not(:disabled) {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
}

.btn-block { width: 100%; padding: 12px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-header {
  background: transparent;
  color: var(--pink);
  border: 1.5px solid var(--pink-mid);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
}
.btn-header:hover { background: var(--pink-light); }

/* ============ Login View ============ */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--white);
  border: 2.5px solid var(--pink-mid);
  border-radius: 28px;
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -32px; right: -32px;
  width: 100px; height: 100px;
  background: var(--cyan-mid);
  border-radius: 50%;
  opacity: 0.25;
}
.login-card::after {
  content: '';
  position: absolute;
  bottom: -24px; left: -24px;
  width: 80px; height: 80px;
  background: var(--pink-mid);
  border-radius: 50%;
  opacity: 0.3;
}

.login-icon { font-size: 36px; margin-bottom: 10px; }
.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 26px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.input {
  width: 100%;
  padding: 11px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--pink-light);
  border: 1.5px solid var(--pink-mid);
  border-radius: 14px;
  transition: border-color 150ms;
}
.input:focus { outline: none; border-color: var(--pink); }

.error-text {
  font-size: 12px;
  color: var(--pink);
  text-align: center;
  font-weight: 600;
}

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #FFF5F9;
  border-bottom: 1.5px solid var(--pink-mid);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* ============ Container ============ */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ============ Dropzone ============ */
.dropzone {
  background: var(--white);
  border: 2.5px dashed var(--pink-mid);
  border-radius: 24px;
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 140ms;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}
.dropzone::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  background: var(--cyan-mid);
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}
.dropzone:hover,
.dropzone.dragover {
  background: var(--pink-light);
  border-color: var(--pink);
}
.dropzone-icon { font-size: 32px; margin-bottom: 12px; }
.dropzone-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.dropzone-text strong { color: var(--pink); }
.dropzone-hint { font-size: 12px; color: var(--text-muted); }

/* ============ Upload progress ============ */
.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--pink-light);
  border: 1.5px solid var(--pink-mid);
  border-radius: 14px;
  font-size: 13px;
  color: var(--pink);
  font-weight: 600;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px; height: 14px;
  border: 2.5px solid var(--pink-mid);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

/* ============ Section header ============ */
.images-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }
.badge {
  background: var(--pink);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  font-variant-numeric: tabular-nums;
}

/* ============ Empty / Loading ============ */
.loading,
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ Image grid ============ */
.images-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ============ Image card ============ */
.image-item {
  background: var(--white);
  border: 1.5px solid var(--pink-mid);
  border-radius: 20px;
  overflow: hidden;
  transition: all 140ms;
}
.image-item:hover {
  border-color: var(--pink);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 96, 154, 0.12);
}

.image-thumb-wrap { position: relative; }
.image-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--pink-light);
}
.image-ext-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--cyan);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.image-info { padding: 10px 12px; }
.image-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.image-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.image-url {
  display: block;
  font-size: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--cyan-mid);
}
.image-url:hover { color: var(--cyan-hover); }
.image-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* インライン削除確認 */
.delete-confirm {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.delete-confirm-text {
  font-size: 11px;
  color: var(--pink);
  font-weight: 600;
}

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--pink);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  text-align: center;
  animation: toast-in 200ms ease, toast-out 200ms ease 2.5s forwards;
}
.toast.cyan { background: var(--cyan); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(247, 96, 154, 0.18);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px;
  background: var(--white);
  border: 2.5px solid var(--pink-mid);
  border-radius: 24px;
  text-align: center;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 8px;
}
.modal-text { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: center; gap: 10px; }

/* ============ Responsive ============ */
@media (max-width: 600px) {
  .container { padding: 20px 16px 60px; }
  .header { padding: 12px 16px; }
  .images-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}
