/* Public Notebook View Page Styles */

.notebook-view-container {
  max-width: 1400px;
  margin: 0 auto;
  /* padding: 2rem; */
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  height: 90vh;
}

/* Header Section */
.notebook-view-header {
  /* margin-bottom: 2rem; */
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.notebook-view-title-container {
  display: flex; 
  align-items: center; 
  gap: 12px;
  margin-bottom: 1rem;
}

.notebook-view-title {
  font-size: 2rem;
  font-weight: 600;
  color: #1f1f1f; 
  margin: 0;
}

.notebook-view-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.notebook-category {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #2e7d32;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.notebook-notes-count,
.notebook-views {
  padding: 0.4rem 1rem;
  background: #d9eefd; 
  color: #667eea;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.notebook-rating {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
  color: #f57c00;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notebook-rating .overall-rating {
  margin-right: 4px;
}

.notebook-rating .user-rating {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1976d2;
  padding: 0.3rem 0.7rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.notebook-rating .user-rating:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* Notebook Actions */
.notebook-actions {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.follow-btn,
.share-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.follow-btn:hover,
.share-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.follow-btn.following {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.follow-btn.following:hover {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  box-shadow: 0 6px 12px rgba(244, 67, 54, 0.4);
}

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

/* Share Modal */
.share-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-modal {
  background: white;
  border-radius: 16px;
  width: 600px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e8e8e8;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px 16px 0 0;
}

.share-modal-header h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.share-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.share-modal-close:hover {
  background-color: #f0f0f0;
  color: #096a2e;
}

.share-modal-body {
  padding: 2rem;
}

.share-modal-description {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.share-link-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.share-link-input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #333;
  background-color: #f8f9fa;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
}

.share-link-input:focus {
  outline: none;
  border-color: #667eea;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.copy-link-btn {
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #096a2e 0%, #0a7d35 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(9, 106, 46, 0.25);
}

.copy-link-btn:hover {
  background: linear-gradient(135deg, #0a7d35 0%, #096a2e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 106, 46, 0.35);
}

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

.copy-link-btn svg {
  width: 18px;
  height: 18px;
}

.copy-success-message {
  color: #28a745;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem;
  background-color: #e8f5e9;
  border-radius: 8px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

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


/* Body Section - Two Column Layout */
.notebook-view-body {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Notes Sidebar */
.notes-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
  padding-right: 1.5rem;
  overflow: hidden;
  min-height: 0;
  padding-top: 25px;
  width: 350px;
  min-width: 250px;
  max-width: 600px;
  flex-shrink: 0;
}

/* Resize Handle */
.resize-handle {
  width: 8px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.resize-handle:hover {
  background: #e0e0e0;
}

.resize-handle:active {
  background: #667eea;
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 40px;
  background: #ccc;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.resize-handle:hover::before {
  opacity: 1;
}

/* Notes Search */
.notes-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.notes-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

.notes-search-input {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 2.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.notes-search-input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: #e0e0e0;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
}

.clear-search-btn:hover {
  background: #d0d0d0;
  color: #333;
}

.clear-search-btn.hidden {
  display: none;
}

/* Notes Sort Dropdown */
.notes-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* margin-bottom: 1rem; */
  flex-shrink: 0;
}

.notes-sort-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

.notes-sort-select {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background-color: #f8f9fa;
  color: #444;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notes-sort-select:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.notes-sort-select:hover {
  border-color: #667eea;
  background: white;
}

/* Pagination Controls */
.notes-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  /* margin-bottom: 1rem; */
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.pagination-btn {
    padding: 4px 10px;
    cursor: pointer;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
    color: #444;
    min-width: 60px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #4a7ceb;
    border-color: #4a7ceb;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(74, 124, 235, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.pagination-info {
  font-size: 0.9rem;
  color: #666;
}

.loading-notes {
  text-align: center;
  padding: 1rem;
  color: #667eea;
  font-weight: 500;
}

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

/* Notes List */
.notes-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.note-item {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
}

.note-item:hover {
  background: #f9fafb;
}

.note-item.active {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-left: 4px solid #096a2e;
}

.note-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f1f1f;
  margin-bottom: 0.5rem;
}

.note-snippet {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.note-meta .note-views {
  background-color: #e3f2fd;
  color: #1976d2;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
}

.note-meta .note-rating {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
  color: #f57c00;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note-meta .overall-rating {
  font-size: 0.7rem;
}

.note-meta .user-rating {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1976d2;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.note-meta .user-rating:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

/* Note Content Area */
.note-content-area {
  padding: 1rem 2rem;
  overflow-y: auto;
  flex: 1;
  min-width: 0;
}

.note-content {
  max-width: 900px;
}

.note-placeholder {
  text-align: center;
  color: #999;
  font-size: 1.1rem;
  padding: 3rem;
}

.note-content h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1f1f1f;
}

.note-content h2 {
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
  color: #333;
}

.note-content h3 {
  font-size: 1.3rem;
  margin: 1.3rem 0 0.8rem;
  color: #444;
}

.note-content p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #555;
}

.note-content ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
  list-style: disc;
}

.note-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
  list-style: decimal;
}

.note-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.note-content code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.note-content pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.note-content pre code {
  background: none;
  padding: 0;
}

.note-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

.note-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #666;
  font-style: italic;
}

.note-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.note-content th,
.note-content td {
  border: 1px solid #e0e0e0;
  padding: 0.5rem;
  text-align: left;
}

.note-content th {
  background: #f9fafb;
  font-weight: 600;
}

/* Scrollbar Styling */
.notes-list::-webkit-scrollbar,
.note-content-area::-webkit-scrollbar {
  width: 8px;
}

.notes-list::-webkit-scrollbar-track,
.note-content-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.notes-list::-webkit-scrollbar-thumb,
.note-content-area::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.notes-list::-webkit-scrollbar-thumb:hover,
.note-content-area::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Rating Dialog */
.rating-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rating-dialog {
  background: white;
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.rating-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e8e8e8;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.rating-dialog-header h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.rating-dialog-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.rating-dialog-close:hover {
  background-color: #f0f0f0;
  color: #096a2e;
}

.rating-dialog-body {
  padding: 2rem;
}

@media (max-width: 480px) {
  .rating-dialog {
    max-width: 95vw;
  }
  
  .rating-dialog-header {
    padding: 1rem 1.25rem;
  }
  
  .rating-dialog-header h3 {
    font-size: 1.25rem;
  }
  
  .rating-dialog-body {
    padding: 1.25rem;
  }
}

.rating-stars {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.rating-stars .star {
  background: none;
  border: none;
  font-size: 36px;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.25rem;
}

.rating-stars .star:hover,
.rating-stars .star.active {
  color: #f59e0b;
  transform: scale(1.15);
}

.rating-input {
  margin-bottom: 1.5rem;
}

.rating-input label {
  display: block;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.95rem;
}

.rating-input input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.rating-input input:focus {
  outline: none;
  border-color: #096a2e;
  box-shadow: 0 0 0 3px rgba(9, 106, 46, 0.1);
}

.rating-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rating-buttons button {
  width: 100%;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.rating-submit {
  background: linear-gradient(135deg, #096a2e 0%, #0a7d35 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(9, 106, 46, 0.25);
}

.rating-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 106, 46, 0.35);
}

.rating-clear {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.rating-clear:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.rating-cancel {
  background-color: #e8e8e8;
  color: #666;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.rating-cancel:hover {
  background-color: #d1d5db;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .notebook-view-body {
    display: flex;
  }
  
  .notes-sidebar {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .notebook-view-container {
    padding: 0 1rem;
  }

  .notebook-view-body {
    display: grid;
    grid-template-columns: 1fr;
  }
  
  .resize-handle {
    display: none;
  }

  .notes-sidebar {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding-right: 0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    padding-top: 25px;
    width: 100%;
    max-width: 100%;
  }

  .note-content-area {
    padding: 1rem 0;
  }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification.toast-success {
  background-color: #28a745;
  color: white;
}

.toast-notification.toast-error {
  background-color: #dc3545;
  color: white;
}

.toast-notification.toast-info {
  background-color: #17a2b8;
  color: white;
}

/* Back Button */
.back-btn {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
  text-decoration: none;
  font-family: inherit;
}

.back-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
  color: white !important;
  text-decoration: none;
}

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

