/* ===================================================================
   Diary System Specific Styles
   日記システム専用スタイル
   ================================================================ */

/* Diary Container */
.diary-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 30px;
  background: linear-gradient(180deg, #fffdfa 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border-light);
  box-shadow: 0 14px 28px rgb(20 24 33 / 12%);
  font-family: 'ヒラギノ明朝 Pro', 'Hiragino Mincho Pro', serif;
  line-height: 2;
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

.diary-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 0%, rgb(255 255 255 / 75%), transparent 45%),
    radial-gradient(circle at 85% 100%, rgb(184 134 46 / 12%), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.diary-container > * {
  position: relative;
  z-index: 1;
}

/* Diary Header */
.diary-header {
  text-align: center;
  border-bottom: 2px double var(--accent-copper);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.diary-date {
  font-size: 24px;
  color: var(--accent-ink);
  margin-bottom: 10px;
  font-weight: 600;
}

.diary-time {
  font-size: 14px;
  color: rgb(31 36 48 / 60%);
}

/* Diary Content */
.diary-content {
  font-size: 16px;
  color: var(--primary-text);
  white-space: pre-line;
}

.diary-content p {
  margin: 20px 0;
  text-indent: 1em;
}

/* Text Highlights */
.highlight-text {
  background: linear-gradient(transparent 60%, rgb(197 138 27 / 35%) 60%);
  font-weight: bold;
  padding: 0 4px;
}

.confused-text {
  color: var(--accent-red);
  font-weight: bold;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.critical-text {
  color: var(--accent-red);
  font-weight: bold;
}

.secret-text {
  color: var(--accent-red);
  font-weight: bold;
}

/* Diary Footer */
.diary-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-light);
  font-size: 13px;
  color: rgb(31 36 48 / 60%);
  text-align: right;
}

/* Special Elements */
.memory-fragment {
  background: rgb(31 75 143 / 8%);
  border-left: 4px solid var(--accent-blue);
  padding: 15px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--accent-blue);
  font-style: italic;
}

.handwritten-note {
  background: #f9f1da;
  border: 1px dashed var(--accent-copper);
  padding: 20px;
  margin: 20px 0;
  font-family: 'Comic Sans MS', cursive;
  font-size: 15px;
  transform: rotate(-1deg);
  box-shadow: 0 8px 18px rgb(20 24 33 / 15%);
}

.gap-notice {
  background: rgb(180 35 24 / 8%);
  border: 2px solid var(--accent-red);
  padding: 20px;
  margin: 30px 0;
  text-align: center;
  font-size: 18px;
  color: var(--accent-red);
  font-weight: bold;
}

.thought-bubble {
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 15px;
  margin: 20px 0;
  font-size: 14px;
  font-style: italic;
  color: rgb(31 36 48 / 70%);
}

.warning-note {
  background: rgb(197 138 27 / 15%);
  border-left: 4px solid var(--accent-yellow);
  padding: 15px;
  margin: 20px 0;
  font-size: 14px;
  color: #7a4d0f;
}

/* Timeline Comparison */
.timeline-comparison {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.timeline-col {
  flex: 1;
  padding: 15px;
  border-radius: 5px;
}

.timeline-col.subjective {
  background: rgb(47 125 87 / 12%);
  border-left: 4px solid var(--accent-green);
}

.timeline-col.objective {
  background: rgb(180 35 24 / 8%);
  border-left: 4px solid var(--accent-red);
}

/* Diary List */
.diary-list {
  list-style: none;
  padding: 0;
}

.diary-list-item {
  background: linear-gradient(160deg, #fff 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s;
  cursor: pointer;
}

.diary-list-item:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 20px rgb(20 24 33 / 12%);
  border-color: var(--accent-blue);
}

.diary-list-date {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.diary-list-preview {
  font-size: 14px;
  color: rgb(31 36 48 / 70%);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.diary-list-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 11px;
  color: rgb(31 36 48 / 70%);
  margin-top: 10px;
  margin-right: 5px;
}

.diary-list-tag.important {
  background: rgb(180 35 24 / 12%);
  color: var(--accent-red);
}

.diary-list-tag.gap {
  background: rgb(197 138 27 / 15%);
  color: #7a4d0f;
}

.diary-list-tag.encrypted {
  background: rgb(31 75 143 / 12%);
  color: var(--accent-blue);
}

/* Diary Profile */
.diary-profile {
  background: linear-gradient(160deg, #fff 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 10px 20px rgb(20 24 33 / 12%);
}

.diary-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}

.diary-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-ink) 0%, var(--accent-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 16px rgb(16 34 58 / 20%);
}

.diary-profile-info h2 {
  font-size: 24px;
  color: var(--accent-ink);
  margin-bottom: 5px;
}

.diary-profile-info p {
  font-size: 14px;
  color: rgb(31 36 48 / 70%);
  margin: 0;
}

.diary-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.diary-stat-item {
  text-align: center;
  padding: 15px;
  background: var(--surface-soft);
  border-radius: 8px;
  border: 1px solid rgb(156 143 122 / 25%);
}

.diary-stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent-blue);
  margin-bottom: 5px;
}

.diary-stat-label {
  font-size: 12px;
  color: #666;
}

/* Diary Categories */
.diary-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.diary-category-button {
  padding: 8px 16px;
  background: rgb(255 255 255 / 90%);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.diary-category-button:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.diary-category-button.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* Diary Archive */
.diary-archive {
  background: linear-gradient(160deg, #fff 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.diary-archive-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-ink);
  margin-bottom: 15px;
}

.diary-archive-list {
  list-style: none;
  padding: 0;
}

.diary-archive-item {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s;
}

.diary-archive-item:hover {
  background: rgb(184 134 46 / 8%);
  padding-left: 20px;
}

.diary-archive-item:last-child {
  border-bottom: none;
}

.diary-archive-month {
  font-weight: bold;
  color: var(--accent-ink);
}

.diary-archive-count {
  float: right;
  color: rgb(31 36 48 / 60%);
  font-size: 12px;
}

/* Diary Search */
.diary-search-box {
  margin: 20px 0;
  position: relative;
}

.diary-search-input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  box-sizing: border-box;
}

.diary-search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgb(31 75 143 / 20%);
}

.diary-search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(31 36 48 / 60%);
  font-size: 18px;
}

/* Diary Entry Metadata */
.diary-metadata {
  display: flex;
  gap: 20px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin: 20px 0;
  font-size: 13px;
}

.diary-metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(31 36 48 / 70%);
}

.diary-metadata-icon {
  font-size: 16px;
  color: rgb(31 36 48 / 60%);
}

/* Diary Mood */
.diary-mood {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
}

.diary-mood.happy {
  background: rgb(47 125 87 / 15%);
  color: var(--accent-green);
}

.diary-mood.sad {
  background: rgb(31 75 143 / 12%);
  color: var(--accent-blue);
}

.diary-mood.anxious {
  background: rgb(197 138 27 / 15%);
  color: #7a4d0f;
}

.diary-mood.confused {
  background: rgb(159 92 60 / 15%);
  color: var(--accent-copper);
}

.diary-mood.hopeful {
  background: rgb(184 134 46 / 18%);
  color: var(--accent-gold);
}

/* Diary Navigation */
.diary-navigation {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
}

.diary-nav-button {
  padding: 10px 20px;
  background: rgb(255 255 255 / 90%);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.diary-nav-button:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateX(-3px);
  box-shadow: 0 8px 16px rgb(31 75 143 / 15%);
}

.diary-nav-button.next:hover {
  transform: translateX(3px);
}

.diary-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Diary Warning Box */
.diary-warning-box {
  background: rgb(197 138 27 / 15%);
  border: 2px solid var(--accent-yellow);
  border-radius: 8px;
  padding: 20px;
  margin: 30px 0;
  display: flex;
  gap: 15px;
  box-shadow: 0 10px 20px rgb(20 24 33 / 12%);
}

.diary-warning-icon {
  font-size: 30px;
  color: var(--accent-yellow);
}

.diary-warning-content {
  flex: 1;
}

.diary-warning-title {
  font-size: 16px;
  font-weight: bold;
  color: #7a4d0f;
  margin-bottom: 8px;
}

.diary-warning-text {
  font-size: 14px;
  color: #7a4d0f;
  line-height: 1.6;
}

/* Responsive adjustments for diary */
@media (width <= 768px) {
  .diary-container {
    padding: 30px 20px;
  }

  .diary-date {
    font-size: 20px;
  }

  .diary-content {
    font-size: 15px;
  }

  .timeline-comparison {
    flex-direction: column;
    gap: 15px;
  }

  .diary-profile-header {
    flex-direction: column;
    text-align: center;
  }

  .diary-profile-stats {
    grid-template-columns: 1fr;
  }

  .diary-metadata {
    flex-direction: column;
    gap: 10px;
  }
}

/* Print styles for diary */
@media print {
  .diary-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .diary-navigation,
  .diary-search-box,
  .diary-categories {
    display: none;
  }

  .diary-content p {
    break-inside: avoid;
  }
}
