/* 基本設定 */
:root {
  --primary-color: #4a6da7;
  --primary-light: #6b8cbe;
  --primary-dark: #345286;
  --secondary-color: #f8c630;
  --success-color: #4caf50;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --text-color: #333;
  --text-light: #666;
  --background-color: #f5f7fa;
  --card-color: #fff;
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Kaku Gothic Pro", "Meiryo", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ヘッダー */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.app-header h1 {
  color: var(--primary-color);
  font-size: 28px;
}

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

/* ボタンスタイル */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-speed);
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: translateY(1px);
}

.btn i {
  font-size: 16px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-light);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #3d8b40;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #d32f2f;
}

.btn-flip {
  background-color: var(--secondary-color);
  color: var(--text-color);
  padding: 10px 20px;
  font-size: 16px;
}

.btn-flip:hover {
  background-color: #e0b12b;
}

/* カード表示エリア */
.card-view {
  margin-bottom: 30px;
}

.card {
  perspective: 1000px;
  width: 100%;
  height: 400px;
  margin: 0 auto;
  max-width: 600px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 8px var(--shadow-color);
  border-radius: var(--border-radius);
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background-color: var(--card-color);
  border-radius: var(--border-radius);
}

.card-back {
  transform: rotateY(180deg);
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  padding: 10px;
}

.text-content {
  font-size: 18px;
  line-height: 1.5;
}

.media-content {
  text-align: center;
}

.media-content img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
}

.audio-content audio {
  width: 100%;
}

.youtube-content .youtube-preview {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  cursor: pointer;
}

.youtube-content .youtube-preview img {
  width: 100%;
  border-radius: 4px;
}

.youtube-content .youtube-preview .youtube-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: red;
  font-size: 48px;
  opacity: 0.9;
  transition: opacity var(--transition-speed);
}

.youtube-content .youtube-preview .youtube-play-button:hover {
  opacity: 1;
}

.card-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.card-feedback {
  text-align: center;
  margin-top: 20px;
}

.card-feedback p {
  margin-bottom: 10px;
  font-weight: 600;
}

.card-feedback .feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* 復習スケジュール設定 */
.review-schedule {
  background-color: var(--card-color);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--shadow-color);
  margin-bottom: 30px;
}

.review-schedule h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.review-schedule .schedule-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.review-schedule .schedule-options .schedule-option {
  padding: 8px 16px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.review-schedule .schedule-options .schedule-option:hover,
.review-schedule .schedule-options .schedule-option.active {
  background-color: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
}

.review-schedule .custom-schedule {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.review-schedule .custom-schedule label {
  font-weight: 600;
}

.review-schedule .custom-schedule input {
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

/* カード追加フォーム */
.add-card-form {
  background-color: var(--card-color);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--shadow-color);
  margin-bottom: 30px;
  display: none;
}

.add-card-form h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.add-card-form .form-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.add-card-form .form-tabs .tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  position: relative;
}

.add-card-form .form-tabs .tab-btn.active {
  color: var(--primary-color);
}

.add-card-form .form-tabs .tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

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

.add-card-form .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.add-card-form .form-group textarea,
.add-card-form .form-group input[type="url"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.add-card-form .form-group input[type="url"] {
  min-height: auto;
}

.add-card-form .form-group .image-preview,
.add-card-form .form-group .audio-preview,
.add-card-form .form-group .youtube-preview {
  margin-top: 10px;
  border: 1px dashed var(--border-color);
  padding: 10px;
  border-radius: var(--border-radius);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.add-card-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* カードリスト */
.card-list {
  background-color: var(--card-color);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px var(--shadow-color);
  margin-bottom: 30px;
  display: none;
}

.card-list h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.card-list .list-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.card-list .list-filters .filter-btn {
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}

.card-list .list-filters .filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.card-list .cards-list {
  list-style: none;
}

.card-list .cards-list .card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.card-list .cards-list .card-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.card-list .cards-list .card-item:last-child {
  border-bottom: none;
}

.card-list .cards-list .card-item .card-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.card-list .cards-list .card-item .card-preview .preview-text {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.card-list .cards-list .card-item .card-preview .preview-image {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
}

.card-list .cards-lists .card-item .card-preview .preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-list .cards-list .card-item .card-schedule {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-list .cards-list .card-item .card-schedule .schedule-time {
  font-size: 14px;
  color: var(--text-light);
}

.card-list .cards-list .card-item .card-schedule .priority-indicator {
  font-size: 16px;
}

.card-list .cards-list .card-item.priority-high .priority-indicator {
  color: var(--danger-color);
}

.card-list .cards-list .card-item.priority-medium .priority-indicator {
  color: var(--warning-color);
}

.card-list .cards-list .card-item.priority-low .priority-indicator {
  color: var(--success-color);
}

/* 通知 */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--card-color);
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  max-width: 400px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.notification .notification-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification .notification-content i {
  font-size: 20px;
  color: var(--primary-color);
}

.notification .notification-content p {
  font-size: 14px;
}

.notification .notification-close {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 10px;
  color: var(--text-light);
  font-size: 16px;
}

.notification .notification-close:hover {
  color: var(--text-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .app-header .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    height: 350px;
  }

  .review-schedule .schedule-options {
    flex-direction: column;
    align-items: stretch;
  }

  .review-schedule .schedule-options .schedule-option {
    text-align: center;
  }

  .review-schedule .custom-schedule {
    flex-direction: column;
    align-items: stretch;
  }

  .review-schedule .custom-schedule input,
  .review-schedule .custom-schedule button {
    width: 100%;
  }

  .card-list .card-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-list .card-item .card-preview {
    width: 100%;
  }

  .card-list .card-item .card-schedule {
    width: 100%;
    justify-content: space-between;
  }

  .notification {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}
