/* =============================================
   WP File Share - Frontend Styles
   THE4KIND Brand Colors
   ============================================= */

:root {
  /* THE4KIND Brand */
  --wfs-primary:    #1878b8;
  --wfs-primary-h:  #1260a0;
  --wfs-primary-lt: #d6eaf8;
  --wfs-accent:     #7ec8d8;
  --wfs-accent-h:   #5fb8cc;
  --wfs-dark:       #111111;
  --wfs-success:    #16a34a;
  --wfs-danger:     #dc2626;
  --wfs-warning:    #d97706;
  --wfs-gray-50:    #f9fafb;
  --wfs-gray-100:   #f3f4f6;
  --wfs-gray-200:   #e5e7eb;
  --wfs-gray-300:   #d1d5db;
  --wfs-gray-500:   #6b7280;
  --wfs-gray-700:   #374151;
  --wfs-gray-900:   #111827;
  --wfs-radius:     10px;
  --wfs-shadow:     0 4px 24px rgba(24,120,184,0.10);
  --wfs-font:       -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

.wfs-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 16px;
  font-family: var(--wfs-font);
  color: var(--wfs-gray-900);
}

/* ── Brand Header ────────────────────────────── */
.wfs-brand-header { text-align: center; margin-bottom: 28px; }
.wfs-brand-header img { height: 48px; width: auto; }

/* ── Card ─────────────────────────────────────── */
.wfs-card {
  background: #fff;
  border-radius: var(--wfs-radius);
  box-shadow: var(--wfs-shadow);
  border-top: 4px solid var(--wfs-primary);
  padding: 32px;
  margin-bottom: 24px;
}
.wfs-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--wfs-gray-100);
  color: var(--wfs-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ──────────────────────────────────── */
.wfs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  line-height: 1;
  font-family: var(--wfs-font);
}
.wfs-btn:hover  { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
.wfs-btn:active { transform: none; box-shadow: none; }

.wfs-btn-primary       { background: var(--wfs-primary); color: #fff; }
.wfs-btn-primary:hover { background: var(--wfs-primary-h); color: #fff; }
.wfs-btn-accent        { background: var(--wfs-accent); color: #fff; }
.wfs-btn-accent:hover  { background: var(--wfs-accent-h); color: #fff; }
.wfs-btn-success       { background: var(--wfs-success); color: #fff; }
.wfs-btn-success:hover { background: #15803d; color: #fff; }
.wfs-btn-danger        { background: var(--wfs-danger); color: #fff; }
.wfs-btn-danger:hover  { background: #b91c1c; color: #fff; }
.wfs-btn-outline       { background: transparent; color: var(--wfs-primary); border: 2px solid var(--wfs-primary); }
.wfs-btn-outline:hover { background: var(--wfs-primary-lt); }
.wfs-btn-sm { padding: 6px 13px; font-size: 0.84rem; }
.wfs-btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* ── Drop Zone ───────────────────────────────── */
.wfs-dropzone {
  border: 2px dashed var(--wfs-accent);
  border-radius: var(--wfs-radius);
  padding: 52px 24px;
  text-align: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fd 100%);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.wfs-dropzone.wfs-drag-over { border-color: var(--wfs-primary); background: var(--wfs-primary-lt); }
.wfs-drop-icon  { font-size: 3.5rem; margin-bottom: 12px; }
.wfs-drop-text  { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; color: var(--wfs-primary); }
.wfs-drop-sub   { color: var(--wfs-gray-500); margin: 0 0 18px; font-size: 0.9rem; }
.wfs-drop-limit { color: var(--wfs-gray-500); margin: 14px 0 0; font-size: 0.83rem; }
.wfs-hidden     { display: none !important; }

/* ── File Queue ──────────────────────────────── */
.wfs-file-queue { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.wfs-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--wfs-gray-50);
  border-radius: 8px;
  border: 1px solid var(--wfs-gray-200);
  border-left: 3px solid var(--wfs-accent);
}
.wfs-queue-icon   { font-size: 1.7rem; flex-shrink: 0; }
.wfs-queue-info   { flex: 1; min-width: 0; }
.wfs-queue-name   { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfs-queue-size   { font-size: 0.83rem; color: var(--wfs-gray-500); }
.wfs-queue-remove { background: none; border: none; cursor: pointer; color: var(--wfs-danger); font-size: 1.1rem; padding: 4px; opacity: 0.7; }
.wfs-queue-remove:hover { opacity: 1; }

/* ── Options Form ────────────────────────────── */
.wfs-options { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--wfs-gray-200); }
.wfs-options h3 { margin: 0 0 18px; font-size: 1rem; color: var(--wfs-primary); font-weight: 700; }

.wfs-form-row { margin-bottom: 16px; }
.wfs-form-row label { display: block; font-weight: 600; font-size: 0.88rem; color: var(--wfs-gray-700); margin-bottom: 5px; }
.wfs-label-note { font-weight: 400; font-size: 0.8rem; color: var(--wfs-gray-500); }
.wfs-form-row input[type="text"],
.wfs-form-row input[type="email"],
.wfs-form-row input[type="password"],
.wfs-form-row select,
.wfs-form-row textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--wfs-gray-300);
  border-radius: 6px;
  font-size: 0.94rem;
  font-family: var(--wfs-font);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wfs-form-row input:focus,
.wfs-form-row select:focus,
.wfs-form-row textarea:focus {
  outline: none;
  border-color: var(--wfs-primary);
  box-shadow: 0 0 0 3px rgba(24,120,184,0.14);
}
.wfs-form-row-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.wfs-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.wfs-toggle input { width: auto; accent-color: var(--wfs-primary); }
.wfs-form-actions { margin-top: 22px; text-align: right; }

/* ── Progress ────────────────────────────────── */
.wfs-progress-wrap { margin-top: 24px; }
.wfs-progress-bar-bg { height: 10px; background: var(--wfs-gray-200); border-radius: 99px; overflow: hidden; }
.wfs-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wfs-primary), var(--wfs-accent));
  border-radius: 99px;
  transition: width 0.3s ease;
}
.wfs-progress-text { text-align: center; font-size: 0.88rem; color: var(--wfs-gray-500); margin-top: 8px; }

/* ── Results ─────────────────────────────────── */
.wfs-result-card {
  background: linear-gradient(135deg, #f0fdf4, #e8f5fe);
  border: 1px solid #a7d8f0;
  border-left: 4px solid var(--wfs-primary);
  border-radius: var(--wfs-radius);
  padding: 22px;
  margin-bottom: 14px;
}
.wfs-result-card h3 { margin: 0 0 14px; color: var(--wfs-primary); font-size: 1rem; }
.wfs-result-url-box {
  display: flex;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--wfs-gray-200);
  border-radius: 6px;
  padding: 9px 13px;
  font-size: 0.86rem;
  word-break: break-all;
  align-items: center;
}
.wfs-result-url-box span { flex: 1; color: var(--wfs-primary); }
.wfs-result-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 0.86rem; color: var(--wfs-gray-500); }

/* ── Download Page ───────────────────────────── */
.wfs-download-container .wfs-card { text-align: center; }
.wfs-download-file-icon { font-size: 4.5rem; margin-bottom: 12px; }
.wfs-download-filename  { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; word-break: break-all; color: var(--wfs-primary); }
.wfs-download-meta      { color: var(--wfs-gray-500); font-size: 0.9rem; margin-bottom: 24px; }
.wfs-download-meta span { margin: 0 8px; }
.wfs-download-actions   { margin-top: 24px; }
.wfs-password-form      { margin: 24px 0; }
.wfs-password-form input { max-width: 280px; }

/* ── My Files ────────────────────────────────── */
.wfs-myfiles-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.wfs-myfiles-header h2 { margin: 0; color: var(--wfs-primary); }

.wfs-tabs { display: flex; border-bottom: 2px solid var(--wfs-gray-200); margin-bottom: 20px; }
.wfs-tab {
  padding: 10px 22px;
  border: none;
  background: none;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--wfs-gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--wfs-font);
}
.wfs-tab-active { color: var(--wfs-primary); border-color: var(--wfs-primary); }
.wfs-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wfs-gray-200); border-radius: 99px; padding: 1px 8px; font-size: 0.76rem; margin-left: 5px;
}
.wfs-tab-active .wfs-tab-count { background: var(--wfs-primary-lt); color: var(--wfs-primary); }

.wfs-file-list { display: flex; flex-direction: column; gap: 8px; }
.wfs-file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--wfs-gray-200);
  border-left: 3px solid var(--wfs-accent);
  border-radius: var(--wfs-radius);
  box-shadow: 0 1px 4px rgba(24,120,184,0.05);
  transition: box-shadow 0.15s, border-left-color 0.15s;
}
.wfs-file-item:hover { box-shadow: 0 4px 16px rgba(24,120,184,0.12); border-left-color: var(--wfs-primary); }
.wfs-file-item.wfs-expired { opacity: 0.55; border-left-color: var(--wfs-gray-300); }

.wfs-file-icon    { font-size: 2rem; flex-shrink: 0; }
.wfs-file-info    { flex: 1; min-width: 0; }
.wfs-file-name    { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfs-file-meta    { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--wfs-gray-500); margin-top: 3px; }
.wfs-file-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Spinner ─────────────────────────────────── */
.wfs-loading { text-align: center; padding: 52px; }
.wfs-spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--wfs-primary-lt);
  border-top-color: var(--wfs-primary);
  border-radius: 50%;
  animation: wfs-spin 0.75s linear infinite;
  margin: 0 auto 16px;
}
@keyframes wfs-spin { to { transform: rotate(360deg); } }

/* ── Notices ─────────────────────────────────── */
.wfs-notice  { padding: 14px 18px; border-radius: 8px; margin-bottom: 14px; }
.wfs-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.wfs-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.wfs-info    { background: var(--wfs-primary-lt); border: 1px solid #93c5fd; color: #1e40af; }

/* ── Badges ──────────────────────────────────── */
.wfs-badge         { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 0.76rem; font-weight: 600; }
.wfs-badge-active  { background: #dcfce7; color: #166534; }
.wfs-badge-expired { background: #fef3c7; color: #92400e; }
.wfs-badge-lock    { background: var(--wfs-primary-lt); color: var(--wfs-primary); }

/* ── Empty State ─────────────────────────────── */
.wfs-empty { text-align: center; padding: 52px 24px; color: var(--wfs-gray-500); }
.wfs-empty p { margin-bottom: 16px; font-size: 0.95rem; }
.wfs-text-danger { color: var(--wfs-danger); }

/* ── Responsive (Mobile) ─────────────────────── */
@media (max-width: 600px) {

  /* カードのパディングを縮小 */
  .wfs-card { padding: 18px 14px; }

  /* マイファイルヘッダーを縦積みに */
  .wfs-myfiles-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .wfs-myfiles-header .wfs-btn { width: 100%; justify-content: center; }

  /* ファイルアイテムを縦積みに */
  .wfs-file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }

  /* ファイル情報（アイコン＋テキスト）を横並びに */
  .wfs-file-icon { font-size: 1.6rem; }
  .wfs-file-info { width: 100%; }
  .wfs-file-name {
    white-space: normal;
    word-break: break-all;
    font-size: 0.9rem;
  }
  .wfs-file-meta { font-size: 0.76rem; gap: 8px; }

  /* ボタン群を横並び・幅いっぱいに */
  .wfs-file-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .wfs-file-actions .wfs-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 70px;
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  /* タブボタンを均等幅に */
  .wfs-tabs { gap: 0; }
  .wfs-tab  { flex: 1; text-align: center; padding: 10px 8px; font-size: 0.86rem; }

  /* 結果URLボックスを縦積みに */
  .wfs-result-url-box { flex-direction: column; align-items: flex-start; }
  .wfs-result-url-box .wfs-btn { width: 100%; justify-content: center; }

  /* ドロップゾーンのパディングを縮小 */
  .wfs-dropzone { padding: 32px 14px; }

  /* フォームの横並び行を縦積みに */
  .wfs-form-row-inline { grid-template-columns: 1fr; }

  /* ダウンロードページのメタ情報を縦並びに */
  .wfs-download-meta { flex-direction: column; gap: 4px; }
  .wfs-download-meta span { margin: 0; }
}
