/* Google Fonts - Kosugi Maru（ロゴ用） */
@import url('https://fonts.googleapis.com/css2?family=Kosugi+Maru&display=swap');

/* 共通スタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* ロゴ用フォント */
.app-logo {
    font-family: "Kosugi Maru", sans-serif;
}

/* ヘッダーセクション */
.header-section {
    background-color: #17B8C4;
    color: white;
    padding: 20px 20px 30px 20px;
    text-align: center;
    overflow: hidden;
}

.header-section h1 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.login-status {
    margin: 0 0 20px 0;
    font-size: 14px;
    opacity: 0.9;
}

/* 入力ボックス */
.input-boxes {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 360px;
    width: 95%;
    margin: 0 auto;
}

.input-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* コーピング入力欄を一時的に非表示（将来実装予定のため残す） */
.input-box:nth-child(2) {
    display: none;
}

.input-box label {
    font-size: 14px;
    font-weight: bold;
    width: 85px;
    flex-shrink: 0;
    text-align: left;
}

.stressor-input,
.coping-input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #666;
    box-sizing: border-box;
}

.stressor-input:focus,
.coping-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* メインコンテンツエリア */
.main-content {
    background-color: #EDF8F9;
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    padding: 20px 10px;
    min-height: calc(100vh - 200px);
    width: 100%;
    box-sizing: border-box;
}

/* タブスイッチ */
.tab-container {
    display: none; /* 一時的に非表示（将来実装予定のため残す） */
    gap: 0;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-button {
    padding: 12px 20px;
    border: 2px solid #17B8C4;
    background-color: transparent;
    color: #17B8C4;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 130px;
}

.tab-button.active {
    background-color: #17B8C4;
    color: white;
}

.tab-button:not(.active) {
    background-color: #EDF8F9;
    border-radius: 0 6px 6px 0;
    border-left: none;
    border-color: #85C2C9;
    color: #85C2C9;
}

.tab-button:hover:not(.active) {
    background-color: rgba(23, 184, 196, 0.1);
}

/* 日付ナビゲーション */
.date-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto 20px auto;
    width: 90%;
    max-width: 360px;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    color: #17B8C4;
    text-decoration: none;
    font-size: 28px;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

.nav-button:hover {
    opacity: 0.7;
}

.current-date {
    font-size: 22px;
    font-weight: bold;
    color: #17B8C4;
    text-align: center;
}

/* テーブル関連（ダッシュボード用） */
table {
  border-collapse: collapse;
  width: 90%;
  max-width: 360px;
  margin: 0 auto;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  border: 4px solid #EDF8F9;
}
th, td {
  padding: 2px;
  text-align: center;
  height: 10px;
  background-color: #D9D9D9; /* テーブルセルのグレー背景 */
}


/* 気分セルの幅 */
.log-cell {
  width: 100%;
}
td:hover {
  background-color: #eef;
  cursor: pointer;
}
td.log-cell {
  padding: 0;
  position: relative;
}

/* 全てのセルをグレー背景で統一 */
/* 共通の棒グラフスタイル */
.bar {
  height: 100%;
  color: white;
  font-size: 0.8em;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* 気分用棒グラフ（左から右へ） */
.mood-bar {
  background-color: #17B8C4; /* デフォルト: 仕事カテゴリの色 */
  text-align: left;
  padding: 0 0 0 4px;
  justify-content: flex-start;
}

/* 活動名ラベル（角丸枠内に表示） */
.activity-label {
  display: inline-block;
  background-color: white;
  color: #333;
  font-size: 15px;
  padding: 0 6px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.2;
}

th.time-cell {
  width: 55px;
  min-width: 55px;
  vertical-align: middle;
  color: #17B8C4;
  font-weight: normal;
  font-size: 16px;
}
.sticky-col {
  position: sticky;
  left: 0;
  background-color: white;
  z-index: 1;
}
.sticky-head {
  position: sticky;
  top: 0;
  background-color: #F0FAFB;
  z-index: 2;
  font-weight: bold;
  color: #17B8C4;
}

/* スケールラベル行 */
.scale-header th {
  background-color: #EDF8F9;
  font-size: 12px;
  font-weight: normal;
  padding: 2px 4px;
  height: 20px;
  color: #17B8C4;
  border: 4px solid #EDF8F9;
}

.scale-labels {
  padding: 0;
}

.scale-arrow-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}

/* 両側矢印 */
.scale-arrow-both {
  flex: 1;
  height: 1px;
  background-color: #85C2C9;
  position: relative;
  margin: 0 4px;
}

.scale-arrow-both::before,
.scale-arrow-both::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  top: 50%;
}

.scale-arrow-both::before {
  left: 0;
  border-width: 3px 3px 3px 0;
  border-color: transparent #85C2C9 transparent transparent;
  transform: translateY(-50%);
}

.scale-arrow-both::after {
  right: 0;
  border-width: 3px 0 3px 3px;
  border-color: transparent transparent transparent #85C2C9;
  transform: translateY(-50%);
}

#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.3);
  z-index: 1000;
  display: none;
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(250, 250, 250, 0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  padding: 30px 20px;
  z-index: 1001;
  display: none;
  width: 90%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-main-title {
  text-align: center;
  font-size: 18px;
  margin: 0 0 20px 0;
  color: #333;
  font-weight: bold;
}

/* カテゴリセクション */
.category-section {
  margin-bottom: 25px;
}

.category-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.category-title.work {
  color: #17B8C4;
}

.category-title.home {
  color: #4CAF50;
}

.category-title.private {
  color: #FF9800;
}

/* 活動ボタン */
.activity-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.activity-btn {
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: white;
  border: 1px solid;
}

.activity-btn.work {
  border-color: #17B8C4;
  color: #17B8C4;
}

.activity-btn.home {
  border-color: #4CAF50;
  color: #4CAF50;
}

.activity-btn.private {
  border-color: #FF9800;
  color: #FF9800;
}

.activity-btn:hover {
  opacity: 0.7;
}

.activity-btn.selected.work {
  background-color: #17B8C4;
  color: white;
}

.activity-btn.selected.home {
  background-color: #4CAF50;
  color: white;
}

.activity-btn.selected.private {
  background-color: #FF9800;
  color: white;
}

/* カスタム入力欄 */
.custom-activity-input {
  width: 100%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 14px;
  margin-top: 8px;
  box-sizing: border-box;
  border: 2px solid;
}

.custom-activity-input.work {
  border-color: #17B8C4;
  color: #17B8C4;
}

.custom-activity-input.home {
  border-color: #4CAF50;
  color: #4CAF50;
}

.custom-activity-input.private {
  border-color: #FF9800;
  color: #FF9800;
}

.custom-activity-input::placeholder {
  color: #ccc;
}

.custom-activity-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(23, 184, 196, 0.2);
}

/* 気分セクション */
.mood-section {
  margin-bottom: 25px;
}

.mood-title {
  text-align: center;
  font-size: 18px;
  margin: 0 0 15px 0;
  color: #333;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.star {
  font-size: 32px;
  color: #17B8C4;
  cursor: pointer;
  transition: all 0.2s ease;
}

.star:hover {
  transform: scale(1.2);
}

.star.filled {
  content: '★';
}

/* モーダルボタン */
.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cancel-btn,
.save-btn {
  flex: 1;
  padding: 15px;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.cancel-btn {
  background-color: white;
  border: 2px solid #17B8C4;
  color: #17B8C4;
}

.cancel-btn:hover {
  background-color: #f5f5f5;
}

.save-btn {
  background-color: #D9D9D9;
  color: white;
}

.save-btn:hover {
  background-color: #c0c0c0;
}

.save-btn.active {
  background-color: #17B8C4;
}

.save-btn.active:hover {
  background-color: #159aa5;
}

/* 削除ボタンセクション */
.modal-delete-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.delete-btn {
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid #E57373;
  background-color: white;
  color: #E57373;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background-color: #E57373;
  color: white;
}

/* フッターナビゲーション */
.footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #17B8C4;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
  border-radius: 20px 20px 0 0;
}

.footer-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: white;
  font-size: 11px;
  gap: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.footer-item.active {
  opacity: 1;
}

.footer-item:hover {
  opacity: 1;
}

.footer-icon {
  width: 24px;
  height: 24px;
}

/* フッター分の余白を確保 */
.main-content {
  padding-bottom: 80px;
}

/* マイページ */
.account-container {
  max-width: 360px;
  width: 90%;
  margin: 0 auto;
  padding: 20px 0;
}

.account-title {
  text-align: center;
  color: #17B8C4;
  font-size: 20px;
  margin: 0 0 30px 0;
}

.account-info {
  background-color: white;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 30px;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

.account-label {
  color: #666;
  font-size: 14px;
}

.account-value {
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.account-menu {
  margin: 30px 0;
}

.account-menu-item {
  display: block;
  padding: 15px 20px;
  background-color: white;
  border-radius: 10px;
  color: #333;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.2s ease;
}

.account-menu-item:hover {
  background-color: #f0f0f0;
}

.account-menu-item::after {
  content: "›";
  float: right;
  color: #999;
  font-size: 20px;
}

.account-actions {
  text-align: center;
  margin-top: 40px;
}

.logout-btn {
  display: inline-block;
  padding: 8px 20px;
  background-color: transparent;
  border: 1px solid #999;
  border-radius: 15px;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* エクスポートセクション */
.export-section {
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  margin: 30px 0;
}

.export-title {
  color: #333;
  font-size: 16px;
  margin: 0 0 15px 0;
}

.export-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-label {
  color: #666;
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

.export-btn {
  display: block;
  padding: 12px 15px;
  background-color: #17B8C4;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  text-align: center;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background-color: #139AA5;
}

.export-pdf-options {
  display: flex;
  gap: 10px;
}

.export-btn-small {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
}

/* アプリ情報セクション */
.app-info-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.app-info-header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.app-info-name {
  font-family: "Kosugi Maru", sans-serif;
  font-size: 16px;
  color: #17B8C4;
}

.app-info-version {
  font-size: 12px;
  color: #999;
}

.app-info-description {
  font-size: 12px;
  color: #666;
  margin: 0 0 15px 0;
}

.app-info-links {
  font-size: 12px;
  margin-bottom: 10px;
}

.app-info-link {
  color: #17B8C4;
  text-decoration: none;
}

.app-info-link:hover {
  text-decoration: underline;
}

.app-info-divider {
  color: #ccc;
  margin: 0 8px;
}

.app-info-copyright {
  font-size: 11px;
  color: #999;
  margin: 0;
}

/* 集計ページ */
.summary-description {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.summary-container {
  max-width: 360px;
  width: 90%;
  margin: 0 auto;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
}

.summary-scale-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.summary-scale-label-left {
  width: 80px;
  flex-shrink: 0;
}

.summary-scale {
  flex: 1;
  text-align: center;
}

.summary-scale .scale-text {
  display: block;
  color: #17B8C4;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
}

.summary-scale .scale-arrow-container {
  font-size: 12px;
  color: #17B8C4;
}

.summary-category-section {
  margin-bottom: 20px;
}

.summary-category-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.summary-category-title.work {
  color: #17B8C4;
}

.summary-category-title.home {
  color: #4CAF50;
}

.summary-category-title.private {
  color: #FF9800;
}

.summary-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.summary-activity-label {
  width: 80px;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 13px;
  text-align: center;
  background-color: white;
  border: 2px solid;
  box-sizing: border-box;
}

.summary-activity-label.work {
  border-color: #17B8C4;
  color: #17B8C4;
}

.summary-activity-label.home {
  border-color: #4CAF50;
  color: #4CAF50;
}

.summary-activity-label.private {
  border-color: #FF9800;
  color: #FF9800;
}

.summary-plot-area {
  flex: 1;
  height: 30px;
  position: relative;
  margin-left: 10px;
}

.summary-plot-area::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background-color: #ddd;
}

.summary-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #ddd;
}

.summary-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
}

.summary-dot.work {
  background-color: #17B8C4;
}

.summary-dot.home {
  background-color: #4CAF50;
}

.summary-dot.private {
  background-color: #FF9800;
}

.no-data {
  text-align: center;
  color: #999;
  padding: 40px 0;
}

/* できごと設定ページ */
.settings-description {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.settings-container {
  max-width: 360px;
  width: 90%;
  margin: 0 auto;
  padding: 20px 0;
}

.settings-category-section {
  margin-bottom: 25px;
}

.settings-category-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.settings-category-title.work {
  color: #17B8C4;
}

.settings-category-title.home {
  color: #4CAF50;
}

.settings-category-title.private {
  color: #FF9800;
}

.activity-list {
  min-height: 40px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  margin-bottom: 8px;
  background-color: white;
  border-radius: 10px;
  border: 2px solid;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.activity-item:active {
  cursor: grabbing;
}

.activity-item.work {
  border-color: #17B8C4;
}

.activity-item.home {
  border-color: #4CAF50;
}

.activity-item.private {
  border-color: #FF9800;
}

.activity-item-label {
  font-size: 14px;
  color: #333;
}

.activity-delete-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.activity-delete-btn:hover {
  color: #E57373;
}

/* ドラッグ中のゴースト */
.sortable-ghost {
  opacity: 0.4;
}

.settings-actions {
  margin-top: 30px;
  text-align: center;
}

.back-btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: white;
  border: 2px solid #17B8C4;
  border-radius: 25px;
  color: #17B8C4;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background-color: #17B8C4;
  color: white;
}

