/* 情熱MAP 作業マニュアル スタイルシート */
:root {
  --primary-color: #2E7D32;
  --primary-dark: #1B5E20;
  --primary-light: #4CAF50;
  --accent-color: #FF9800;
  --bg-color: #f4f6f8;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border-color: #e0e0e0;
  --danger-color: #f44336;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
}

/* ヘッダー */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-title {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-btn:active {
  background: rgba(255,255,255,0.4);
}

/* メインコンテナ */
.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

/* タブナビゲーション */
.tab-bar {
  display: flex;
  background: white;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 6px rgba(46,125,50,0.3);
}

/* 検索 & フィルターバー */
.search-bar {
  background: white;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary-color);
}

/* マニュアルカード */
.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.manual-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  border: 1px solid #eee;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.manual-card:active {
  transform: scale(0.98);
}

.manual-card-img-wrap {
  width: 100%;
  height: 160px;
  background: #eaeff2;
  position: relative;
  overflow: hidden;
}

.manual-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manual-badge-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.manual-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.manual-card-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.manual-card-notice {
  background: #fff8e1;
  border-left: 3px solid #ffb300;
  padding: 6px 8px;
  font-size: 12px;
  color: #8f6b00;
  border-radius: 0 4px 4px 0;
  margin-bottom: 8px;
  line-height: 1.4;
}

.manual-works-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
}

.work-tag {
  background: #e8f5e9;
  color: var(--primary-dark);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
  border: 1px solid #c8e6c9;
}

/* フォーム・入力系 */
.form-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #444;
  margin-bottom: 6px;
}

.form-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* 写真プレビューグリッド */
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.photo-preview-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid #ddd;
  background: #000;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-action-overlay {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  justify-content: space-around;
  padding: 4px 0;
}

.photo-btn-mini {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

/* モーダル表示 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  background: var(--primary-color);
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 写真編集用キャンバス */
.editor-canvas-container {
  width: 100%;
  max-height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.editor-canvas {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  touch-action: none;
}
