/* Main Dashboard Layout */
.dashboard {
  max-width: 100%;
  margin: 0 auto;
  padding: 0px;
}

/* Welcome Header */
.welcome-header {
  background: #222831;
  color: white !important;
  border-radius: 0px;
  padding: 10px;
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.welcome-header h2 {
  color: white !important;
  margin: 0;
  font-size: 1.8rem;
}

.quick-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.stat-box {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 2px 4px;
  border-radius: 8px;
  text-align: center;
  min-width: 40px;
}

.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.welcome-header .stat-box .stat-label {
  color: white !important;
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .welcome-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 20px 15px;
  }
  
  .welcome-header h2 {
    font-size: 1.5rem;
    width: 100%;
    margin-bottom: 15px;
  }
  
  .welcome-header .quick-stats {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 8px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
  
  .welcome-header .stat-box {
    padding: 8px 10px !important;
    min-width: 0 !important;
    border-radius: 6px !important;
    flex: 1 !important;
  }
  
  .stat-num {
    font-size: 1.4rem !important;
    margin-bottom: 2px;
  }
  
  .stat-label {
    font-size: 0.65rem !important;
    line-height: 1.1;
  }
}

@media (max-width: 480px) {
  .stat-box {
    padding: 6px 8px;
  }
  
  .stat-num {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
}

/* Three Column Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 20% 1fr 20%;
  gap: 30px;
  margin-top: 20px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.dashboard-left,
.dashboard-right {
  min-width: 0;
}
.dashboard-center {
  overflow: hidden;
}

/* Dashboard Cards */
.dashboard-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  overflow: hidden;
  width: 100%;
}

.dashboard-card h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  color: #333;
}

/* Empty States */
.empty-message {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

/* Responsive Layout */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 25% 1fr 25%;
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .dashboard-left {
    order: 1;
  }
  
  .dashboard-center {
    order: 2;
  }
  
  .dashboard-right {
    order: 3;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    padding: 0 10px;
    gap: 15px;
  }
  
  .dashboard-card {
    padding: 15px;
  }
  
  /* Make carousel scrollable on mobile */
  .carousel-track {
    padding: 10px 0;
  }
  
  .carousel-book-wrapper {
    width: 130px;
  }
  
  .carousel-cover,
  .carousel-placeholder {
    width: 130px !important;
    height: 195px !important;
  }
  
  .carousel-info {
    width: 130px;
  }
}

@media (max-width: 480px) {
  .carousel-book-wrapper {
    width: 110px;
  }
  
  .carousel-cover,
  .carousel-placeholder {
    width: 110px !important;
    height: 165px !important;
  }
  
  .carousel-info {
    width: 110px;
  }
  
  .carousel-info strong {
    font-size: 0.8rem;
  }
  
  .carousel-info .book-author {
    font-size: 0.7rem;
  }
}
  


@media (max-width: 768px) {
  .quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }
  
  .stat-box {
    min-width: auto;
    padding: 12px;
  }
  
  .stat-num {
    font-size: 1.5rem;
  }
}

/* ========================================
   NEWLY ADDED BOOKS CAROUSEL
   ======================================== */

.books-carousel {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 15px 5px;
  width: 100%;
}

.carousel-track::-webkit-scrollbar {
  height: 8px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 4px;
}

.carousel-book-wrapper {
  flex-shrink: 0;
  width: 150px;
}

.carousel-book-wrapper a {
  display: block;
  text-decoration: none;
}

.carousel-cover {
  width: 150px !important;
  height: 225px !important;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  display: block;
}

.carousel-placeholder {
  width: 150px !important;
  height: 225px !important;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.carousel-book-wrapper:hover .carousel-cover,
.carousel-book-wrapper:hover .carousel-placeholder {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.carousel-info {
  text-align: center;
  width: 150px;
}

.carousel-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.2;
}

.carousel-info strong a {
  color: #2d3748;
  text-decoration: none;
}

.carousel-info strong a:hover {
  color: #667eea;
}

.carousel-info .book-author {
  display: block;
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.carousel-info .author-link {
  color: #667eea;
  text-decoration: none;
  font-size: 0.75rem;
  display: inline;
}

.carousel-info .author-link:hover {
  color: #5568d3;
  text-decoration: underline;
}

/* Carousel Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: #667eea;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.carousel-btn:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carousel-btn.prev {
  left: -15px;
}

.carousel-btn.next {
  right: -15px;
}

/* Want to Read Grid */
.want-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.want-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s;
}

.want-cover {
  width: 50px;
  height: 75px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.want-cover-placeholder {
  width: 50px;
  height: 75px;
  background: #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.want-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.want-info strong {
  font-size: 0.9rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.want-info span {
  font-size: 0.8rem;
  color: #666;
}
/* Carousel Container and Controls */
.books-carousel {
  position: relative;
  padding: 0 40px; /* Make room for buttons on sides */
}

/* Hide scrollbar but keep functionality */
.carousel-track {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari */
.carousel-track::-webkit-scrollbar {
  display: none;
}

/* Carousel Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 2px solid #ddd;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s;
  z-index: 10;
}

.carousel-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

/* Currently Reading */
.reading-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.reading-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
  transition: background 0.3s;
}

.reading-item:hover {
  background: #f0f0f0;
}

.reading-cover-link {
  flex-shrink: 0;
}

.reading-cover {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.reading-cover-placeholder {
  width: 60px;
  height: 90px;
  background: #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.reading-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.reading-info strong {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.3;
}

.reading-info strong a {
  color: #333;
  text-decoration: none;
}

.reading-info strong a:hover {
  color: #667eea;
}

.book-author {
  font-size: 0.85rem;
  color: #666;
}

/* Progress Bar */
.progress-bar-small {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-small .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.progress-text {
  font-weight: 600;
  color: #667eea;
}

.page-text {
  color: #718096;
  font-size: 0.8rem;
}

.btn-update-progress {
  display: inline-block;
  padding: 6px 12px;
  background: white;
  color: #667eea;
  border: 1px solid #667eea;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s;
  align-self: flex-start;
  margin-top: 4px;
}

.btn-update-progress:hover {
  background: #667eea;
  color: white;
}

/* Book Progress on Dashboard */
.book-progress-section {
  margin: 10px 0;
}

.progress-bar-small {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar-small .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #718096;
  margin-bottom: 8px;
}

.progress-text {
  font-weight: 600;
  color: #667eea;
}

.page-text {
  font-size: 0.8rem;
}

/* Quick Progress Form */
.quick-progress-form {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
}

.quick-progress-input {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: center;
}

.quick-progress-input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-tiny.add-to-library {
  margin-top: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
  display: inline-block;
  text-align: center;
}

.btn-tiny.add-to-library:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.btn-tiny.add-to-library:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-tiny.add-to-library.added {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.reading-since {
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 8px;
  font-style: italic;
}

/* Book card adjustments */
.book-card-dashboard {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: 220px;
}

.book-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card-info h4 {
  margin-bottom: 4px;
}

.book-card-info h4 a {
  color: #2d3748;
  text-decoration: none;
}

.book-card-info h4 a:hover {
  color: #667eea;
}

/* Progress Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  margin: 0;
  color: #2d3748;
  font-size: 1.3rem;
}

.modal-close {
  font-size: 2rem;
  color: #a0aec0;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #667eea;
}

.modal-body {
  padding: 25px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
}

.progress-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.progress-input {
  width: 80px;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1.1rem;
  text-align: center;
  transition: border-color 0.3s;
}

.progress-input:focus {
  outline: none;
  border-color: #667eea;
}

.input-separator {
  color: #718096;
  font-weight: 500;
}

.total-pages {
  font-weight: bold;
  color: #2d3748;
}

.form-divider {
  text-align: center;
  margin: 25px 0;
  position: relative;
}

.form-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e2e8f0;
}

.form-divider span {
  position: relative;
  background: white;
  padding: 0 15px;
  color: #a0aec0;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.btn-success {
  background: #48bb78;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-success:hover {
  background: #38a169;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  transition: background 0.3s;
}

.activity-item:hover {
  background: #f3f4f6;
}

.activity-user {
  flex-shrink: 0;
}

.activity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.activity-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: #2d3748;
  line-height: 1.4;
}

.activity-text strong {
  color: #667eea;
  font-weight: 600;
}

.activity-text a {
  color: #2d3748;
  text-decoration: none;
  font-weight: 600;
}

.activity-text a:hover {
  color: #667eea;
  text-decoration: underline;
}

.activity-time {
  margin: 0;
  font-size: 0.8rem;
  color: #a0aec0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.activity-badge.finished {
  background: linear-gradient(135deg, #e6ffe6 0%, #ccffcc 100%);
  color: #00aa00;
}

.activity-badge.started {
  background: linear-gradient(135deg, #e6f7ff 0%, #cce7ff 100%);
  color: #0066cc;
}

.activity-badge.added {
  background: linear-gradient(135deg, #fff4e6 0%, #ffe6cc 100%);
  color: #ff9900;
}
