/* 2. PREMIUM INSTAGRAM-STYLE COMMENT MODAL */

.comments-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.comments-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.comments-modal {
  width: 100%;
  max-width: 600px;
  height: 85vh;
  background: rgba(20, 20, 25, 0.85);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.comments-modal-overlay.active .comments-modal {
  transform: translateY(0);
}

.modal-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 12px auto;
  cursor: grab;
}

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

.comments-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.comments-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.comments-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.comments-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar for comments */
.comments-body::-webkit-scrollbar {
  width: 6px;
}
.comments-body::-webkit-scrollbar-track {
  background: transparent;
}
.comments-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Comment Input System */
.comments-input-area {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.user-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-input-wrapper {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 8px 16px;
  transition: border-color 0.3s ease;
}

.comment-input-wrapper:focus-within {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

.comment-textfield {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: none;
  max-height: 100px;
  min-height: 24px;
  outline: none;
  padding: 0;
  line-height: 1.4;
}

.comment-textfield::placeholder {
  color: var(--text-muted);
}

.comment-actions-mini {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.action-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.action-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.comment-send-btn {
  background: var(--accent-gold);
  border: none;
  color: #000;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.comment-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.comment-send-btn:active {
  transform: scale(0.95);
}

.comment-send-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  cursor: not-allowed;
  transform: scale(1);
}

/* LIGHT THEME STYLING OVERRIDES */
[data-theme="light"] .comments-modal {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: none;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-drag-handle {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .comments-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comments-close-btn {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
}

[data-theme="light"] .comments-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

[data-theme="light"] .comments-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .comments-input-area {
  background: rgba(241, 245, 249, 0.95);
  border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .user-mini-avatar {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .comment-input-wrapper {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .comment-input-wrapper:focus-within {
  background: #ffffff;
  border-color: var(--accent-gold, #2563eb);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .comment-textfield {
  color: #0f172a;
}

[data-theme="light"] .action-icon-btn {
  color: #64748b;
}

[data-theme="light"] .action-icon-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comment-send-btn:disabled {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.25);
}

