/* ========== Unsent Messages - New Modern Design ========== */

.unsent-page-new {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 80px);
}

/* Header Section */
.unsent-header-new {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 50px;
  padding: 40px 30px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
  border-radius: 20px;
  border: 2px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
}

.unsent-header-new:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
}

.unsent-header-content h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.unsent-header-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
  line-height: 1.5;
}

/* Write Button */
.unsent-write-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.unsent-write-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.unsent-write-btn:active {
  transform: translateY(0);
}

.unsent-write-btn svg {
  width: 18px;
  height: 18px;
}

/* Feed Container */
.unsent-feed-container {
  position: relative;
  min-height: 200px;
}

/* Feed Grid */
.unsent-feed-grid {
  display: grid;
  gap: 30px;
  margin-bottom: 40px;
}

/* Message Card Styles */
.unsent-card {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe8cc 100%);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
  transition: all 0.2s ease;
}

.unsent-card:hover {
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.15);
  transform: translateY(-2px);
}

/* Card Header - To/From */
.unsent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 107, 107, 0.1);
}

.unsent-to-from {
  flex: 1;
}

.unsent-to {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

.unsent-from {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.unsent-badge {
  display: inline-block;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Card Content */
.unsent-card-content {
  margin: 16px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Georgia', serif;
}

/* Card Footer */
.unsent-card-footer {
  margin: 12px 0;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 107, 107, 0.1);
}

.unsent-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Card Actions */
.unsent-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.unsent-btn {
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  color: #667eea;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unsent-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.4);
}

.unsent-btn:active {
  transform: scale(0.98);
}

/* Reactions Display */
.reactions-display {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.reaction-pill {
  padding: 4px 10px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-pill:hover {
  background: rgba(255, 107, 107, 0.2);
}

/* Comments Section */
.unsent-comments-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 107, 107, 0.1);
}

.comments-list {
  margin-bottom: 12px;
}

.comment-item {
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 107, 107, 0.05);
  border-radius: 6px;
  font-size: 13px;
}

.comment-author {
  font-weight: 600;
  color: #666;
  margin-bottom: 2px;
}

.comment-text {
  color: #333;
  margin-bottom: 4px;
}

.comment-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.comment-form {
  margin-top: 8px;
}

.comment-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

/* Reactions Display */
.reactions-display {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  min-height: 28px;
  align-items: center;
}

.reaction-pill {
  background: white;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-pill:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.reaction-emoji {
  font-size: 14px;
}

.reaction-num {
  font-size: 11px;
  color: #999;
  min-width: 15px;
}

/* Comments Section */
.comments-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 107, 107, 0.1);
}

.comments-header {
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  background: white;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #667eea;
  font-size: 13px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comment-author {
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
  font-size: 12px;
}

.comment-text {
  color: #666;
  line-height: 1.4;
  word-wrap: break-word;
  font-size: 13px;
}

.comment-date {
  color: #aaa;
  font-size: 11px;
  margin-top: 4px;
}

.no-comments {
  color: #999;
  font-style: italic;
  font-size: 12px;
}

/* Loading State */
.unsent-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.unsent-loading.hidden {
  display: none;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin-animation 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin-animation {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.unsent-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.unsent-empty.hidden {
  display: none;
}

.empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.unsent-empty h3 {
  font-size: 20px;
  margin: 0 0 10px 0;
  color: var(--text-primary);
  font-weight: 600;
}

.unsent-empty p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ========== MODAL STYLES ========== */

.modal-overlay-new {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay-new.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-overlay-new.active {
  display: flex !important;
  opacity: 1;
}

.modal-new {
  background: var(--bg-secondary);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 0;
  position: relative;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modal-slide-in 0.3s ease;
}

@keyframes modal-slide-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.unsent-modal {
  display: flex;
  flex-direction: column;
}

.modal-header-new {
  padding: 25px 30px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-new h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-new {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.modal-close-new:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Form Styles */
.unsent-form-new {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input,
.form-field textarea,
.form-field select {
  padding: 12px 14px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-secondary);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
  font-family: 'Georgia', serif;
  line-height: 1.6;
}

.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.char-count {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

.char-count.warning {
  color: #ffa500;
  font-weight: 600;
}

.char-count.error {
  color: #ff6b6b;
  font-weight: 600;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  padding-top: 20px;
}

.btn-cancel,
.btn-submit {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-cancel {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.btn-cancel:hover {
  background: rgba(139, 92, 246, 0.15);
}

.btn-submit {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Download Button */
.download-btn {
  background: none;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #667eea;
  transition: all 0.2s ease;
  font-weight: 500;
}

.download-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .unsent-page-new {
    padding: 15px;
  }

  .unsent-header-new {
    flex-direction: column;
    gap: 20px;
    padding: 30px 20px;
  }

  .unsent-header-content h1 {
    font-size: 28px;
  }

  .unsent-write-btn {
    width: 100%;
    justify-content: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .unsent-card {
    padding: 24px;
    max-width: 100%;
  }

  .unsent-card-content {
    font-size: 15px;
    line-height: 1.6;
  }

  .unsent-feed-grid {
    gap: 20px;
  }

  .modal-new {
    max-width: 95%;
  }

  .modal-header-new {
    padding: 20px;
  }

  .unsent-form-new {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .unsent-page-new {
    padding: 10px;
  }

  .unsent-header-new {
    padding: 20px 15px;
  }

  .unsent-header-content h1 {
    font-size: 24px;
  }

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

  .unsent-write-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .unsent-card {
    padding: 20px;
    margin: 0;
  }

  .unsent-card-content {
    font-size: 14px;
  }

  .letter-line {
    font-size: 13px;
  }

  .action-button {
    font-size: 12px;
    padding: 3px 6px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-cancel,
  .btn-submit {
    width: 100%;
  }

  .modal-new {
    max-width: 100%;
    border-radius: 12px;
  }

  .modal-header-new {
    padding: 15px;
  }

  .modal-header-new h2 {
    font-size: 18px;
  }

  .unsent-form-new {
    padding: 15px;
    gap: 15px;
  }

  .form-field textarea {
    min-height: 120px;
  }
}
