* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
  color: #333;
}

/* =====================
   共通（幅統一）
===================== */
input,
button,
select {
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  outline: none;
}

/* =====================
   ログインカード
===================== */
.card {
  max-width: 400px;
  width: 90%;
  margin: 80px auto;
  padding: 30px;
  background: #fff;
  border-radius: 14px;
  text-align: center;
}

.card h2 {
  margin-bottom: 20px;
}

.card input {
  padding: 12px;
  margin-top: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: 0.2s;
}

.card input:focus {
  border-color: #4CAF50;
}

.card button {
  padding: 12px;
  margin-top: 14px;
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.card button:hover {
  background: #43a047;
}

/* =====================
   非表示
===================== */
.hidden {
  display: none !important;
}

/* =====================
   ヘッダー
===================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2c2c2c;
  color: #fff;
  padding: 14px 20px;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

header button {
  width: auto;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #ff5252;
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
}

header button:hover {
  background: #e53935;
}

/* =====================
   メインコンテナ
===================== */
.container {
  max-width: 600px;
  width: 95%;
  margin: 20px auto;
}

/* =====================
   ドロップエリア
===================== */
.drop-area {
  border: 2px dashed #aaa;
  padding: 40px 20px;
  text-align: center;
  border-radius: 12px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: 0.2s;
}

.drop-area:hover {
  background: #f0f8ff;
  border-color: #4CAF50;
}

.drop-area.dragover {
  background: #e3f2fd;
  border-color: #2196f3;
}

.drop-area input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  top: 0;
  left: 0;
  cursor: pointer;
}

/* =====================
   有効期限
===================== */
.expire {
  margin: 15px 0;
  text-align: center;
}

.expire select {
  margin-top: 6px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* =====================
   ファイルリスト
===================== */
#fileList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#fileList li {
  width: 100%;
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
  transition: 0.2s;
}

#fileList li:hover {
  transform: translateY(-2px);
}

/* ファイル名 */
.file-name {
  font-size: 14px;
  margin-bottom: 8px;
  word-break: break-all;
}

/* =====================
   画像プレビュー
===================== */
.preview {
  margin-top: 8px;
}

.preview img {
  max-width: 120px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.preview img:hover {
  transform: scale(1.05);
}

/* =====================
   ダウンロードボタン
===================== */
.download-btn {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #4CAF50;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.download-btn:hover {
  background: #43a047;
}

/* =====================
   共有URLフィールド
===================== */
#fileList input {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 12px;
  background: #fafafa;
  cursor: pointer;
}

/* =====================
   ローディング
===================== */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================
   モーダル（画像拡大）
===================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.active {
  display: flex;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

/* =====================
   スクロール改善
===================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* =====================
   レスポンシブ
===================== */
@media (max-width: 600px) {

  .card {
    margin: 40px auto;
    padding: 20px;
  }

  header h1 {
    font-size: 16px;
  }

  .drop-area {
    padding: 25px 10px;
    font-size: 14px;
  }

  #fileList li {
    padding: 10px;
  }

  .preview img {
    max-width: 100px;
  }
}