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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  display: flex;
  max-width: 700px;
  margin: 0 auto;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0px 60px 0px rgb(255 255 255 / 32%);
}

.journal-content {
  flex: 1;
  padding: 0 20px 20px 0;
  overflow-y: auto;
  height: calc(100vh - 83px);
}

.bubble {
  max-width: 100%;
  margin: 15px 0;
  padding: 15px 18px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  line-height: 1.4;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble.user {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

.bubble.user::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: #0056b3;
  border-bottom: 0;
}

.bubble-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

.link-preview {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.link-preview-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.link-preview-description {
  font-size: 11px;
  opacity: 0.8;
  line-height: 1.3;
}

.link-preview-url {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 5px;
}

.bubble-container {
  margin: 1px 0px 1px 130px;
  gap: 15px;
  width: calc(100% - 120px);
}

.date-timestamp {
  min-width: 50px;
  font-size: 11px;
  color: #6c757d;
  text-align: left;
  padding-top: 0px;
  line-height: 1.3;
  margin-left: 17px;
  transition: opacity 0.2s ease;
}

.date-header-container {
  display: flex;
  align-items: flex-start;
  margin: 0 27px;
  gap: 15px;
  position: sticky;
  top: 97px;
  background: rgb(247 248 253);
  backdrop-filter: blur(8px);
  z-index: 80;
  padding: 0;
  width: 67px;
  transition: opacity 0.2s ease;
}

.date-header-left {
  min-width: 67px;
  font-size: 40px;
  font-weight: bold;
  color: #495057;
  text-align: center;
  padding-top: 2px;
}

.hashtag-header-right {
  min-width: 50px;
  font-size: 15px;
  color: #274f98;
  text-align: right;
  padding-top: 0px;
  line-height: 1.3;
  margin-right: 17px;
  transition: opacity 0.2s ease;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: -13px;
}

.bubble {
  margin: 0;
  flex: 1;
}

.year-header-container {
  display: flex;
  align-items: flex-start;
  margin: 30px 0 0;
  gap: 15px;
  position: sticky;
  top: 0;
  background: rgb(247 248 253);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 7px 0px 2px 15px;
  width: 120px;
}

.year-header-container:first-child {
  margin-top: 0;
}

.year-header-left {
  min-width: 80px;
  font-size: 30px;
  font-weight: bold;
  color: #343a40;
  text-align: right;
  padding-top: 2px;
}

.month-header-container {
  align-items: unset;
  margin: 0px 0 0px 0;
  position: sticky;
  top: 50px;
  background: rgb(0 117 242);
  backdrop-filter: blur(8px);
  z-index: 90;
  padding: 11px 13px 11px 13px;
  width: 119px;
  text-align: right;
  transition: opacity 0.2s ease;
}

.month-header-left {
  min-width: 80px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2px;
}

.date-header-container:nth-child(3) + .bubble-container {
  margin-top: -100px;
}
.date-header-container + .bubble-container {
  margin-top: -50px;
}

.floating-input-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

.floating-input-container.shadow-top {
  box-shadow: 0 -10px 20px -5px rgba(0, 0, 0, 0.1);
}

.floating-input-box {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 8px 8px 8px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.floating-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px 0;
  max-height: 120px;
  overflow-y: auto;
  background: transparent;
}

.floating-textarea::placeholder {
  color: #999;
}

.send-btn {
  width: 36px;
  height: 36px;
  background: #007bff;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #0056b3;
  transform: scale(1.05);
}

.send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.add-btn {
  width: 36px;
  height: 36px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-right: 5px;
}

.add-btn:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.add-options {
  position: absolute;
  bottom: 70px;
  left: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  display: none;
  animation: fadeIn 0.2s ease;
  z-index: 1010;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.add-options.show {
  display: block;
}

.add-option {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.add-option:hover {
  background: #f5f5f5;
}

.add-option-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #007bff;
}

.add-option-text {
  font-size: 14px;
  color: #333;
}

/* Audio recording styles */
.audio-recorder {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  z-index: 999;
  display: none;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.audio-recorder.show {
  display: block;
}

.audio-recorder-content {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.audio-timer {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  font-family: monospace;
  min-width: 80px;
}

.audio-visualizer {
  flex: 1;
  height: 40px;
  background: #f0f0f0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.audio-visualizer-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
}

.audio-visualizer-bar {
  width: 3px;
  background: #007bff;
  height: 10px;
  border-radius: 1px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    height: 10px;
  }
  50% {
    height: 25px;
  }
  100% {
    height: 10px;
  }
}

.audio-controls {
  display: flex;
  gap: 10px;
}

.audio-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audio-btn.record {
  background: #dc3545;
  color: white;
}

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

.audio-btn.save {
  background: #28a745;
  color: white;
}

.audio-btn:hover {
  transform: scale(1.05);
}

/* Audio player in bubble */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 12px;
  border-radius: 12px;
}

.audio-player-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.audio-player-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.audio-player-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-player-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: white;
  border-radius: 2px;
}

.audio-player-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  min-width: 70px;
  text-align: right;
}
