/* Simple Calendar Styles */
.simple-calendar table {
  -webkit-border-horizontal-spacing: 0px;
  -webkit-border-vertical-spacing: 0px;
  background-color: rgba(0, 0, 0, 0);
  border: 1px solid rgb(221, 221, 221);
  border-collapse: collapse;
  box-sizing: border-box;
  max-width: none;
  width: 100%;
}

.simple-calendar tr {
  border-collapse: collapse;
}

.simple-calendar th {
  border-bottom: 1px solid rgb(221, 221, 221);
  border-collapse: collapse;
  border-left: 1px solid rgb(221, 221, 221);
  border-right: 1px solid rgb(221, 221, 221);
  border-top: 1px solid rgb(221, 221, 221);
  box-sizing: border-box;
  text-align: left;
}

.simple-calendar td {
  border-bottom: 1px solid rgb(221, 221, 221);
  border-collapse: collapse;
  border-left: 1px solid rgb(221, 221, 221);
  border-right: 1px solid rgb(221, 221, 221);
  border-top: 1px solid rgb(221, 221, 221);
  box-sizing: border-box;
  height: 100px;
  vertical-align: top;
  width: 14.2857%;
}

.simple-calendar .day {
  height: 100px;
  padding: 7px;
  vertical-align: top;
  width: 14.2857%;
}

.simple-calendar .today {
  background-color: #fcf8e3;
}

.simple-calendar .past {
  color: #999;
}

.simple-calendar .future {
  color: #999;
}

.simple-calendar .prev-month {
  color: #999;
}

.simple-calendar .next-month {
  color: #999;
}

.simple-calendar .calendar-heading {
  border: 0px;
  margin: 0px;
}

.simple-calendar .calendar-title {
  color: black;
}

/* レイアウトスタイル */
.main-content {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  min-height: 600px;
}

.calendar-section {
  flex: 2;
  min-width: 0;
  height: 600px; /* 固定高さ */
  max-height: 600px; /* 最大高さ制限 */
  overflow: hidden; /* はみ出し防止 */
  padding-right: 20px;
}

.task-form-section {
  flex: 1;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.task-form-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

/* カレンダーのスタイル調整 */
.simple-calendar {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  height: 100%;
  max-height: 560px; /* 内部の最大高さ */
  overflow-y: auto; /* 縦スクロール可能 */
  display: flex;
  flex-direction: column;
  will-change: transform; /* GPU加速 */
}

.simple-calendar table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
  table-layout: fixed; /* テーブル幅を固定 */
}

.simple-calendar th, .simple-calendar td {
  padding: 15px 10px;
  border: 1px solid #eee;
  vertical-align: top;
  height: 120px; /* セルの高さを固定 */
  max-height: 120px; /* 最大高さを制限 */
  position: relative;
  overflow: hidden; /* はみ出しを隠す */
  width: 14.28%; /* 7列均等割り */
}

.simple-calendar th {
  background: #007bff;
  color: white;
  font-weight: bold;
  text-align: center;
  height: auto;
  padding: 15px 10px;
}

.simple-calendar .day {
  font-weight: bold;
  margin-bottom: 5px;
}

/* タスク表示の最適化 */
.task {
  background: #007bff;
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin: 2px 0;
  position: relative;
  will-change: transform; /* GPU加速 */
  transition: all 0.2s ease; /* スムーズなアニメーション */
  word-wrap: break-word; /* 長い文字列を折り返し */
  overflow: hidden; /* はみ出しを隠す */
  text-overflow: ellipsis; /* はみ出した文字を省略 */
  max-height: 80px; /* タスクの最大高さ */
  line-height: 1.2;
}

.task:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  background: #0056b3; /* ホバー時の色変更 */
}

.task-summary:hover {
  background: #e7f3ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.complete-indicator {
  font-size: 10px;
  color: #dc3545;
  font-weight: bold;
}

/* カレンダーナビゲーションの日本語化 */
.simple-calendar .calendar-heading {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  padding: 15px 0;
}

.simple-calendar .calendar-heading a {
  color: #007bff;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.simple-calendar .calendar-heading a:hover {
  background-color: #f8f9fa;
  color: #0056b3;
}

/* 曜日のカスタマイズ */
.simple-calendar .day-of-week {
  font-weight: bold;
  text-align: center;
}

/* 月の表示をカスタマイズ */
.simple-calendar .month-header {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* アクティブタスクサマリー */
.active-tasks-summary {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.active-tasks-summary h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #333;
}

.task-list {
  max-height: 200px;
  overflow-y: auto;
}

.task-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 5px;
  background: white;
  border-radius: 4px;
  border-left: 3px solid #007bff;
  font-size: 13px;
}

.task-info-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.task-actions {
  margin-left: 10px;
}

.task-actions span{
  display: inline-block;
  margin-right: 5px;
  font-size: 18px;
  color: white;
  background-color: #0056b3;
  padding: 15px 10px;
  border-radius: 20px;

}

.task-name {
  font-weight: 500;
  color: #333;
}

.task-progress {
  font-size: 11px;
  background: #28a745;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
}

.more-tasks {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

.no-tasks {
  font-size: 13px;
  color: #888;
  text-align: center;
  font-style: italic;
  padding: 20px 0;
}

/* ナビゲーション */
.app-navigation {
  margin-bottom: 20px;
  text-align: right;
  display: flex;
  justify-content:space-between;
  align-items: center;
  margin: auto 60px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  margin: 0 60px;
}

.app-navigation span{
  display: inline-block;
  margin-right: 10px;
}

.nav-list{
  display: flex;
  gap: 10px;
  justify-content: left;
}

li{
  list-style: none;

}

.btn {
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.nav-list a:hover {
  background-color: #0056b3;
  color: white;
}

.nav-list a {
  background-color: #3aac73;
  color: white;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-outline-success {
  color: #28a745;
  border-color: #28a745;
  background-color: transparent;
}

.btn-outline-success:hover {
  background-color: #28a745;
  color: white;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
  border-color: #ffc107;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

/* タスクのスタイル */
.task.completed {
  background: #28a745;
}

.task-info {
  font-size: 9px;
  margin-top: 2px;
}

.complete-btn {
  background: #ffc107;
  color: #212529;
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 9px;
  margin-top: 2px;
  display: inline-block;
  transition: background-color 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.complete-btn:hover {
  background: #e0a800;
}

/* フォームのスタイル（コンパクト） */
.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 13px;
  color: #555;
}

.field input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.field select {
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 5px;
}

.submit-btn {
  background: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  font-weight: bold;
}

.submit-btn:hover {
  background: #0056b3;
}

/* 完了タスクページのスタイル */
.completed-tasks-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.stats {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.total-completed {
  margin: 0;
  font-size: 18px;
  color: #28a745;
}

.completed-tasks-list {
  margin-top: 20px;
}

.completed-task-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.completed-task-card.removing {
  opacity: 0;
  transform: translateX(-20px) scale(0.95);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.task-duration {
  background: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.task-details {
  margin-bottom: 15px;
}

.task-dates {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
}

.start-date, .end-date {
  font-size: 14px;
  color: #666;
}

.completion-info {
  font-size: 14px;
  color: #28a745;
  font-weight: bold;
}

.task-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.no-completed-tasks {
  text-align: center;
  padding: 60px 20px;
}

.empty-state h3 {
  color: #666;
  margin-bottom: 15px;
}

.empty-state p {
  color: #888;
  margin-bottom: 20px;
}

/* 分析ページのスタイル */
.analysis-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
  min-height: 100vh;
}

.page-header {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* 基本統計 */
.stats-summary {
  margin-bottom: 30px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.summary-item {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

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

.summary-value {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

/* メイングラフ */
.main-chart {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.chart-container .chart-header {
  background: #007bff;
  color: white;
  padding: 20px;
  text-align: center;
}

.chart-container .chart-header h3 {
  margin: 0;
  font-size: 18px;
}

.chart-description {
  margin: 5px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
}

.chart-wrapper {
  padding: 30px;
  height: 400px;
  position: relative;
}

.chart-wrapper canvas {
  max-height: 100% !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .analysis-page {
    padding: 15px;
  }
  
  .page-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-wrapper {
    height: 300px;
    padding: 20px;
  }
/* アクセシビリティ改善 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.required::after {
    content: " *";
    color: #e74c3c;
}

/* フォーカス表示の改善 */
button:focus,
input:focus,
select:focus,
.task-item:focus,
.task-summary:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* エラーメッセージのスタイル */
.error-messages {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.field-help {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}