/* カレンダー・スケジュール管理 - メインCSS */

/* 基本スタイル */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.App {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー */
.main-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #4a90e2 0%, #7b68ee 100%);
  padding: 25px;
  border-radius: 15px;
  color: white;
  box-shadow: 0 8px 32px rgba(74, 144, 226, 0.3);
}

.title-section h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-navigation {
  flex-grow: 1;
}

.fixed-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.navigation-link {
  display: inline-block;
  padding: 10px 18px;
  background: rgba(255,255,255,0.2);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.navigation-link:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,255,255,0.2);
}

.back-link {
  background: rgba(255,255,255,0.3) !important;
  font-weight: 600;
}

/* メインコンテンツレイアウト */
.main-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 25px;
  min-height: 70vh;
}

/* カレンダーコントロール */
.calendar-controls {
  grid-column: 1 / -1;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.nav-btn {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: linear-gradient(135deg, #357abd, #4a90e2);
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.current-period h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
  min-width: 200px;
  text-align: center;
}

.view-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.view-buttons {
  display: flex;
  gap: 5px;
  background: #f8f9fa;
  padding: 5px;
  border-radius: 10px;
}

.view-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #6c757d;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn.active {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.view-btn:hover:not(.active) {
  background: #e9ecef;
  color: #495057;
}

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

.today-btn, .add-event-btn, .project-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.today-btn {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
}

.add-event-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
}

.project-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
}

.today-btn:hover, .add-event-btn:hover, .project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* カレンダーコンテナ */
.calendar-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  overflow: hidden;
}

.calendar-view {
  display: none;
  min-height: 600px;
}

.calendar-view.active {
  display: block;
}

/* 月間ビュー */
.month-calendar {
  padding: 20px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 10px;
  background: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.weekday {
  background: #f8f9fa;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.weekday:first-child {
  color: #dc3545; /* 日曜日 */
}

.weekday:last-child {
  color: #007bff; /* 土曜日 */
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-cell {
  background: white;
  min-height: 100px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-cell:hover {
  background: #f8f9fa;
  transform: scale(1.02);
}

.calendar-cell.other-month {
  background: #f8f9fa;
  color: #adb5bd;
}

.calendar-cell.today {
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  border: 4px solid #28a745;
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.calendar-cell.holiday {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.calendar-cell.saturday {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.calendar-cell.saturday .day-number {
  color: #1565c0;
}

/* 祝日が土曜日の場合は祝日色を優先 */
.calendar-cell.saturday.holiday {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.calendar-cell.saturday.holiday .day-number {
  color: #dc3545;
}

.day-number {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 5px;
}

.holiday-text {
  color: #dc3545;
}

.holiday-name {
  font-size: 10px;
  color: #dc3545;
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1.2;
}

.event {
  background: #007bff;
  color: white;
  padding: 2px 6px;
  margin: 1px 0;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.event:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* イベントカテゴリ別カラー */
.event-meeting { background: #007bff; }
.event-work { background: #28a745; }
.event-deadline { background: #dc3545; }
.event-release { background: #ffc107; color: #333; }
.event-personal { background: #6f42c1; }
.event-other { background: #6c757d; }

/* 複数日予定の特別スタイル */
.multi-day-event {
  border-left: 4px solid rgba(255, 255, 255, 0.8);
  font-weight: 600;
  position: relative;
}

.multi-day-event::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

/* 週間ビュー */
.week-calendar {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.week-header {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-bottom: 2px solid #e9ecef;
  background: #f8f9fa;
}

.time-column {
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e9ecef;
}

.week-day-header {
  background: white;
  padding: 15px 10px;
  text-align: center;
  border-right: 1px solid #e9ecef;
}

.week-day-header.holiday {
  background: #f8d7da;
}

.week-day-header.saturday {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.week-day-header.saturday .day-date {
  color: #1565c0;
}

.week-day-header.today {
  background: #d4edda;
  border: 3px solid #28a745;
  font-weight: bold;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.3);
}

.day-name {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 5px;
}

.day-date {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
}

.week-content {
  flex: 1;
  display: grid;
  grid-template-columns: 80px 1fr;
  overflow-y: auto;
  max-height: 600px;
}

.time-slots {
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
}

.time-slot {
  height: 60px;
  padding: 5px;
  border-bottom: 1px solid #e9ecef;
  font-size: 12px;
  color: #6c757d;
  display: flex;
  align-items: flex-start;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
}

.day-column {
  border-right: 1px solid #e9ecef;
  position: relative;
  min-height: 1440px; /* 24時間 × 60px */
}

.day-column::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 59px,
    #e9ecef 59px,
    #e9ecef 60px
  );
  pointer-events: none;
}

.week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  background: #007bff;
  color: white;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
  overflow: hidden;
}

.event-time {
  font-size: 10px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.event-title {
  font-weight: 500;
  line-height: 1.2;
}

/* 日別ビュー */
.day-calendar {
  padding: 20px;
}

.day-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 10px;
}

.day-header h3 {
  margin: 0 0 10px 0;
  font-size: 1.8rem;
  color: #2c3e50;
}

#day-title.saturday {
  color: #1565c0 !important;
  font-weight: 600 !important;
}

#day-title.holiday {
  color: #dc3545 !important;
  font-weight: 600 !important;
}

.day-header.saturday {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
}

.day-header.holiday {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb) !important;
}

.day-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.day-info span {
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.business-day {
  background: #d4edda;
  color: #155724;
}

.non-business-day {
  background: #f8d7da;
  color: #721c24;
}

.day-time-slots {
  max-height: 600px;
  overflow-y: auto;
}

.day-time-slot {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-bottom: 1px solid #e9ecef;
  min-height: 60px;
}

.time-label {
  background: #f8f9fa;
  padding: 10px;
  border-right: 1px solid #e9ecef;
  font-size: 14px;
  font-weight: 500;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.event-container {
  padding: 5px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.event-container:hover {
  background: #f8f9fa;
}

.day-event {
  background: #007bff;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 2px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-event:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* 年間ビュー */
.year-calendar {
  padding: 20px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.year-month {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.year-month:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.year-month-header {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
}

.mini-calendar {
  font-size: 12px;
}

.mini-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 5px;
}

.mini-weekdays div {
  text-align: center;
  font-weight: 600;
  color: #6c757d;
  padding: 5px 0;
}

.mini-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.mini-day {
  text-align: center;
  padding: 6px 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-day:hover {
  background: #e9ecef;
}

.mini-day.other-month {
  color: #adb5bd;
}

.mini-day.today {
  background: #28a745;
  color: white;
  font-weight: bold;
  border: 2px solid #155724;
}

.mini-day.holiday {
  color: #dc3545;
  font-weight: 500;
}

.mini-day.saturday {
  color: #1565c0;
  font-weight: 500;
}

/* 祝日が土曜日の場合は祝日色を優先 */
.mini-day.saturday.holiday {
  color: #dc3545;
}

.mini-day.has-events {
  background: #007bff;
  color: white;
}

/* サイドパネル */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.today-events, .holiday-info, .project-list, .business-calc {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.today-events h3, .holiday-info h3, .project-list h3, .business-calc h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  color: #2c3e50;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 10px;
}

.events-list, .holiday-list {
  max-height: 200px;
  overflow-y: auto;
}

.today-event, .holiday-item {
  padding: 10px;
  margin: 5px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.today-event:hover {
  transform: translateX(5px);
}

.holiday-item {
  background: #f8f9fa;
  border-left: 4px solid #dc3545;
}

.holiday-date {
  font-size: 13px;
  color: #6c757d;
}

.holiday-name {
  font-weight: 600;
  color: #dc3545;
}

.holiday-days {
  font-size: 12px;
  color: #28a745;
}

.no-events, .no-holidays {
  text-align: center;
  color: #6c757d;
  padding: 20px;
  font-style: italic;
}

/* プロジェクト関連 */
.projects-container {
  max-height: 150px;
  overflow-y: auto;
}

.project-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: 5px 0;
  border-radius: 6px;
  background: #f8f9fa;
}

.project-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.project-name {
  font-weight: 500;
  font-size: 14px;
}

.project-stats {
  font-size: 12px;
  color: #6c757d;
}

/* 営業日計算 */
.calc-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}

.date-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  margin: 0;
}

.calc-form input[type="date"] {
  padding: 8px 10px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

.calc-form input[type="date"]:focus {
  outline: none;
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.date-separator {
  font-size: 16px;
  font-weight: 600;
  color: #6c757d;
  margin: 0 5px;
  padding-bottom: 8px;
}

.calc-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.calc-result {
  min-height: 50px;
}

.calc-placeholder {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  font-size: 14px;
}

.calc-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 20px;
}

.calc-period {
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(21, 87, 36, 0.2);
}

.calc-period strong {
  color: #155724;
  font-size: 16px;
}

.period-text {
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  display: block;
  margin-top: 5px;
}

.calc-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  border-radius: 6px;
  padding: 15px;
}

.calc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  padding: 5px 0;
  border-bottom: 1px solid rgba(21, 87, 36, 0.1);
}

.calc-item:last-child {
  border-bottom: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid rgba(21, 87, 36, 0.2);
}

.calc-label {
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.calc-value {
  font-weight: 700;
  color: #155724;
  font-size: 16px;
  background: rgba(21, 87, 36, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .side-panel {
    order: -1;
    flex-direction: row;
    overflow-x: auto;
  }
  
  .today-events, .holiday-info, .project-list, .business-calc {
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  .App {
    padding: 10px;
  }
  
  .main-header {
    flex-direction: column;
    text-align: center;
  }
  
  .calendar-controls {
    padding: 15px;
  }
  
  .view-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .calendar-navigation {
    flex-wrap: wrap;
  }
  
  .current-period h2 {
    font-size: 1.4rem;
    min-width: auto;
  }
  
  .calendar-grid {
    gap: 0;
  }
  
  .calendar-cell {
    min-height: 80px;
    padding: 4px;
  }
  
  .day-number {
    font-size: 14px;
  }
  
  .event {
    font-size: 10px;
    padding: 1px 4px;
  }
  
  .side-panel {
    flex-direction: column;
  }
  
  .week-content {
    max-height: 400px;
  }
  
  .day-time-slots {
    max-height: 400px;
  }
}

/* モーダルスタイル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 15px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 15px 15px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #2c3e50;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #e9ecef;
  color: #495057;
}

/* イベントフォーム */
.event-form {
  padding: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: scale(1.2);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 25px;
  border-top: 2px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 15px 15px;
}

.save-btn, .delete-btn, .cancel-btn, .edit-btn, .add-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.save-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.save-btn:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.delete-btn {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #c82333, #dc3545);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

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

.cancel-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.edit-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
}

.edit-btn:hover {
  background: linear-gradient(135deg, #0056b3, #007bff);
  transform: translateY(-2px);
}

.add-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
}

.add-btn:hover {
  background: linear-gradient(135deg, #138496, #17a2b8);
  transform: translateY(-2px);
}

/* プロジェクト管理モーダル */
.project-form {
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
}

.projects-list {
  padding: 20px 25px;
  max-height: 300px;
  overflow-y: auto;
}

.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  margin: 10px 0;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.project-info {
  flex: 1;
}

.project-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 5px;
}

.project-deadline {
  font-size: 13px;
  color: #6c757d;
}

/* イベントポップアップ */
.event-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  min-width: 300px;
  max-width: 500px;
  animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.popup-content {
  padding: 0;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px 12px 0 0;
}

.popup-header h4 {
  margin: 0;
  font-size: 1.2rem;
  color: #2c3e50;
  font-weight: 600;
}

.popup-details {
  padding: 20px;
}

.popup-item {
  display: flex;
  margin-bottom: 12px;
}

.popup-label {
  font-weight: 600;
  color: #495057;
  min-width: 80px;
  margin-right: 10px;
}

.popup-value {
  color: #2c3e50;
  flex: 1;
}

.popup-actions {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
  justify-content: flex-end;
}

/* フォームの改善 */
.form-group input[type="time"]:disabled,
.form-group input[type="time"]:disabled {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}

/* カテゴリ別セレクトスタイル */
.form-group select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

/* スクロールバーのカスタマイズ */
.events-list::-webkit-scrollbar,
.holiday-list::-webkit-scrollbar,
.projects-container::-webkit-scrollbar,
.projects-list::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.week-content::-webkit-scrollbar,
.day-time-slots::-webkit-scrollbar {
  width: 8px;
}

.events-list::-webkit-scrollbar-track,
.holiday-list::-webkit-scrollbar-track,
.projects-container::-webkit-scrollbar-track,
.projects-list::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.week-content::-webkit-scrollbar-track,
.day-time-slots::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.events-list::-webkit-scrollbar-thumb,
.holiday-list::-webkit-scrollbar-thumb,
.projects-container::-webkit-scrollbar-thumb,
.projects-list::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.week-content::-webkit-scrollbar-thumb,
.day-time-slots::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.events-list::-webkit-scrollbar-thumb:hover,
.holiday-list::-webkit-scrollbar-thumb:hover,
.projects-container::-webkit-scrollbar-thumb:hover,
.projects-list::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.week-content::-webkit-scrollbar-thumb:hover,
.day-time-slots::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* モバイル対応の追加調整 */
@media (max-width: 480px) {
  .modal-content {
    margin: 20px;
    max-width: calc(100vw - 40px);
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .popup-item {
    flex-direction: column;
    margin-bottom: 15px;
  }
  
  .popup-label {
    min-width: auto;
    margin-bottom: 5px;
  }
  
  .calc-form {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .date-input-group {
    min-width: auto;
    width: 100%;
  }
  
  .date-separator {
    text-align: center;
    margin: 0;
    padding: 5px 0;
    font-size: 18px;
  }
}