/**
 * DIARY SCORE STYLES - Phase 3
 * Styling for day score, tags, and NOT TO DO system
 */

/* ===== SCORE SCREEN ===== */
.score-display {
  text-align: center;
  margin: 40px 0;
}

.score-value {
  font-size: 5rem;
  font-weight: bold;
  color: var(--diary-gold);
  display: block;
  line-height: 1;
  transition: color 0.3s ease;
}

.score-label {
  font-size: 1.2rem;
  color: #888;
  margin-top: 10px;
  display: block;
}

.score-slider-container {
  padding: 0 20px;
  margin: 30px 0;
}

.score-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--diary-gold) 50%, #333 50%);
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--diary-gold);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  transition: transform 0.2s;
}

.score-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.score-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--diary-gold);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  border: none;
  transition: transform 0.2s;
}

.score-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.score-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #666;
  font-size: 0.8rem;
}

.score-hints {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  padding: 0 10px;
}

.hint {
  font-size: 0.85rem;
  color: #666;
}

/* ===== TAGS SCREEN ===== */
.tags-section {
  margin: 25px 0;
}

.tags-header {
  font-size: 1rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tags-header.constructors {
  color: #4ade80;
}

.tags-header.destructors {
  color: #f87171;
}

.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Custom scrollbar for tags grid */
.tags-grid::-webkit-scrollbar {
  width: 6px;
}

.tags-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.tags-grid::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

.tags-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

.tag-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
  color: #ccc;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag-btn:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.tag-btn.tag-positive.selected {
  background: rgba(74, 222, 128, 0.2);
  border-color: #4ade80;
  color: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.tag-btn.tag-negative.selected {
  background: rgba(248, 113, 113, 0.2);
  border-color: #f87171;
  color: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.tag-icon {
  font-size: 1.1rem;
}

.tag-name {
  white-space: nowrap;
}

/* ===== NOTE SECTION ===== */
.note-section {
  margin: 30px 0;
}

.note-header {
  font-size: 1rem;
  color: #888;
  margin-bottom: 10px;
}

.diary-note-input {
  width: 100%;
  min-height: 100px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.diary-note-input:focus {
  outline: none;
  border-color: var(--diary-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.diary-note-input::placeholder {
  color: #555;
}

/* ===== NOT TO DO SECTION (Map) ===== */
.nottodo-section {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.1) 0%, rgba(30, 30, 60, 0.3) 100%);
  border-radius: 16px;
  padding: 20px;
  margin: 30px 0;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.nottodo-title {
  color: #f87171;
  font-size: 1.2rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nottodo-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.nottodo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.nottodo-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.nottodo-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.nottodo-text {
  color: #ccc;
  font-size: 0.95rem;
}

.nottodo-impact {
  color: #f87171;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.nottodo-message {
  color: #888;
  font-size: 0.8rem;
  margin-top: 4px;
}

.nottodo-empty {
  text-align: center;
  color: #666;
  padding: 30px;
  font-style: italic;
}

/* ===== CONSTRUCTORS SECTION ===== */
.constructors-section {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(30, 30, 60, 0.3) 100%);
  border-radius: 16px;
  padding: 20px;
  margin: 30px 0;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.constructors-title {
  color: #4ade80;
  font-size: 1.2rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.constructors-subtitle {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.constructor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.constructor-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.constructor-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.constructor-text {
  color: #ccc;
  font-size: 0.95rem;
}

.constructor-impact {
  color: #4ade80;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.constructor-message {
  color: #888;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ===== SCORE BAR IN MAP ===== */
.score-bar-container {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.score-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* ===== POTENTIAL SCORE ===== */
.potential-score {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(74, 222, 128, 0.1) 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.potential-score-title {
  color: var(--diary-gold);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.potential-score-values {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.current-avg {
  text-align: center;
}

.current-avg-label {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.current-avg-value {
  font-size: 2rem;
  font-weight: bold;
  color: #888;
}

.potential-avg {
  text-align: center;
}

.potential-avg-label {
  color: #4ade80;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.potential-avg-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: #4ade80;
}

.arrow {
  font-size: 1.5rem;
  color: var(--diary-gold);
}

/* ===== TODAY ADVICE ===== */
.today-advice {
  margin: 20px 0;
}

.advice-section {
  margin: 15px 0;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
}

.advice-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.advice-title.avoid {
  color: #f87171;
}

.advice-title.do {
  color: #4ade80;
}

.advice-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.advice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.advice-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.advice-item-icon {
  font-size: 1.2rem;
}

.advice-item-text {
  color: #ccc;
}

.advice-item-impact {
  font-weight: bold;
  font-size: 0.9rem;
}

.advice-item-impact.negative {
  color: #f87171;
}

.advice-item-impact.positive {
  color: #4ade80;
}

.advice-potential {
  text-align: center;
  padding: 15px;
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .score-value {
    font-size: 4rem;
  }

  .tags-grid {
    max-height: 150px;
  }

  .tag-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  .potential-score-values {
    flex-direction: column;
    gap: 10px;
  }

  .arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 480px) {
  .score-value {
    font-size: 3.5rem;
  }

  .score-label {
    font-size: 1rem;
  }

  .tags-grid {
    max-height: 120px;
  }

  .diary-note-input {
    min-height: 80px;
    font-size: 0.9rem;
  }
}

/* Score bar in map views (Grid/List) */
.grid-cell-score {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 0 0 4px 4px;
}

.score-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

.list-entry-score {
  font-size: 1.2rem;
  font-weight: bold;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

/* Entry detail modal - Phase 3 additions */
.entry-detail-score-display {
  display: flex;
  align-items: center;
  gap: 15px;
}

.entry-detail-score-value {
  font-size: 2.5rem;
  font-weight: bold;
  min-width: 80px;
}

.entry-detail-score-bar {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.entry-detail-score-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 6px;
}

.entry-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  border: 1px solid;
  transition: all 0.2s ease;
}

.detail-tag-positive {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.detail-tag-negative {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.entry-detail-note {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid var(--diary-gold);
  font-style: italic;
  color: #ccc;
  line-height: 1.6;
  margin-top: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===== GRID CELL SCORE NUMBER (Phase 3 Enhancement) ===== */
.grid-cell-score-number {
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  margin-top: 2px;
  text-align: center;
  width: 100%;
}

.grid-cell-score-number.no-score {
  color: #666;
  font-size: 1.2rem;
}

/* ===== LIST ENTRY SCORE LARGE (Phase 3 Enhancement) ===== */
.list-entry-score-large {
  font-size: 2rem;
  font-weight: bold;
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  min-width: 60px;
  text-align: center;
}

.list-entry-score-large.no-score {
  color: #666;
  font-size: 1.5rem;
}

/* Remove old small score style if it exists */
.list-entry-score {
  display: none;
}

/* ===== MAP GRID CELL LAYOUT ENHANCEMENT ===== */
.grid-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px;
  min-height: 80px;
}

.grid-cell-date {
  font-size: 0.75rem;
  color: #888;
  font-weight: normal;
}

.grid-cell-energy {
  font-size: 1.5rem;
  margin: 4px 0;
}

/* ===== SCORE COLOR LEGEND ===== */
.score-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.score-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Score color classes for quick reference */
.score-excellent { color: #4ade80; } /* 80-100 */
.score-good { color: #d4af37; }      /* 60-79 */
.score-fair { color: #fb923c; }      /* 40-59 */
.score-poor { color: #f87171; }      /* 20-39 */
.score-critical { color: #dc2626; }  /* 0-19 */

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .grid-cell-score-number {
    font-size: 1.2rem;
    bottom: 2px;
  }

  .list-entry-score-large {
    font-size: 1.6rem;
    min-width: 50px;
    padding: 2px 8px;
  }
}

@media (max-width: 480px) {
  .grid-cell-score-number {
    font-size: 1rem;
  }

  .list-entry-score-large {
    font-size: 1.4rem;
    min-width: 45px;
  }
}
