* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: #0f0f23;
  color: #e2e8f0;
  min-height: 100vh;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 3px;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: #00d4aa;
  transition: all 0.3s ease;
  display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.mobile-overlay.active {
  display: block;
}

/* Sidebar Styles */
.sidebar {
  width: 250px;
  background: #1a1a2e;
  border-right: 1px solid #2d2d44;
  padding: 2rem 0;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.logo {
  padding: 0 2rem;
  margin-bottom: 3rem;
}

.logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00d4aa;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #94a3b8;
  font-size: 1rem;
  border-radius: 10px;
  width: 100%;
}

.nav-item:hover {
  background: rgba(0, 212, 170, 0.1);
  color: #00d4aa;
}

.nav-item.active {
  background: rgba(0, 212, 170, 0.15);
  color: #00d4aa;
  font-weight: 600;
}

.nav-icon {
  font-size: 1.2rem;
}

.nav-text {
  font-weight: inherit;
}

/* Mobile User Section */
.mobile-user-section {
  display: none;
  margin-top: 2rem;
  padding: 0 2rem;
  border-top: 1px solid #2d2d44;
  padding-top: 2rem;
}

.mobile-user-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 212, 170, 0.1);
  border-radius: 10px;
  text-align: center;
}

.mobile-user-welcome {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.9rem;
}

.mobile-logout-btn,
.mobile-login-btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  min-height: 44px;
}

.mobile-logout-btn {
  background: #ef4444;
  color: white;
}

.mobile-logout-btn:hover {
  background: #dc2626;
}

.mobile-login-btn {
  background: #00d4aa;
  color: #0f0f23;
}

.mobile-login-btn:hover {
  background: #00b894;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 2rem;
  padding-top: 5rem;
  overflow-y: auto;
  background: #0f0f23;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #00d4aa;
}

/* Content Type Toggle */
.content-type-toggle {
  display: flex;
  gap: 0.5rem;
  background: #1a1a2e;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid #2d2d44;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.toggle-btn.active {
  background: #00d4aa;
  color: #0f0f23;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.toggle-icon {
  font-size: 1.1rem;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 0.5rem;
  background: #1a1a2e;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid #2d2d44;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-btn.active {
  background: #00d4aa;
  color: #0f0f23;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

/* Search Container */
.search-container {
  position: relative;
}

.search-box {
  position: relative;
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  padding: 1rem 3rem 1rem 3rem;
  border: 1px solid #2d2d44;
  border-radius: 15px;
  background: #1a1a2e;
  color: #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #00d4aa;
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.search-box input::placeholder {
  color: #64748b;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #64748b;
  z-index: 1;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: #64748b;
  color: #1a1a2e;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.search-clear:hover {
  background: #94a3b8;
  transform: translateY(-50%) scale(1.1);
}

.search-clear.visible {
  display: flex;
}

/* Collection Stats */
.collection-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #00d4aa;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #94a3b8;
  font-weight: 500;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Collection Carousel - DEFAULT DESKTOP BEHAVIOR */
.collection-carousel {
  position: relative;
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.carousel-container {
  overflow: hidden;
  border-radius: 15px;
}

.carousel-track {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(5, 1fr);
  min-height: 400px;
  align-items: start;
}

.carousel-item {
  width: 100%;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #00d4aa;
  color: #0f0f23;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.carousel-btn:hover {
  background: #00b894;
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

/* Content Cards */
.content-card {
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.content-card:hover {
  transform: translateY(-5px);
  border-color: #00d4aa;
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.2);
}

.content-poster {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.content-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-poster {
  width: 100%;
  height: 100%;
  background: #2d2d44;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #64748b;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.content-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
  line-height: 1.3;
}

.content-year {
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.content-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.content-badge.movie {
  background: rgba(0, 212, 170, 0.2);
  color: #00d4aa;
}

.content-badge.tv {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.content-overview {
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-actions {
  margin-top: auto;
}

.content-rating {
  margin-bottom: 1rem;
}

.rating-display {
  color: #fbbf24;
  font-weight: 600;
}

.no-rating {
  color: #64748b;
  font-style: italic;
}

/* Buttons */
.add-btn,
.rate-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-btn {
  background: #00d4aa;
  color: #0f0f23;
}

.add-btn:hover {
  background: #00b894;
  transform: translateY(-2px);
}

.rate-btn {
  background: #fbbf24;
  color: #0f0f23;
}

.rate-btn:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}

/* Pagination */
.pagination-info {
  text-align: center;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 1rem;
}

/* Empty States */
.empty-collection,
.no-results {
  text-align: center;
  color: #94a3b8;
  font-size: 1.2rem;
  padding: 3rem;
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  border-radius: 15px;
  margin: 2rem 0;
  grid-column: 1 / -1;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #1a1a2e;
  border: 1px solid #2d2d44;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal-header {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #0f0f23;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #0f0f23;
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(15, 15, 35, 0.2);
}

.modal-body {
  padding: 2rem;
}

/* Auth Styles */
.auth-section {
  text-align: center;
}

.auth-subtitle {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #2d2d44;
  border-radius: 10px;
  background: #0f0f23;
  color: #e2e8f0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #00d4aa;
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-group input::placeholder {
  color: #64748b;
}

.submit-btn {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #0f0f23;
  padding: 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-top: 1rem;
}

/* User Info */
#userInfo {
  position: fixed;
  top: 20px;
  left: 270px;
  background: #1a1a2e;
  border: 1px solid #2d2d44;
  padding: 1rem 1.5rem;
  border-radius: 15px;
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 200;
  color: #e2e8f0;
}

.logout-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Rating Modal */
.content-preview {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.modal-poster {
  width: 80px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-poster .no-poster {
  width: 100%;
  height: 100%;
  background: #2d2d44;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #64748b;
}

.content-details {
  flex: 1;
}

.content-details h4 {
  color: #e2e8f0;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.content-details p {
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.rating-section {
  text-align: center;
}

.rating-label {
  color: #e2e8f0;
  font-weight: 500;
  margin-bottom: 1rem;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.star {
  cursor: pointer;
  transition: all 0.2s ease;
  filter: grayscale(1);
  opacity: 0.3;
  position: relative;
  color: #fbbf24; /* Base gold color */
}

.star:hover,
.star.active {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.1);
  color: #fbbf24; /* Gold color for full stars */
}

.star.half {
  background: linear-gradient(90deg, #fbbf24 50%, rgba(100, 116, 139, 0.3) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: grayscale(0);
  opacity: 1;
}

/* Ensure full stars override half star styling */
.star.active:not(.half) {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
  color: #fbbf24 !important;
}

.rating-value {
  color: #00d4aa;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.rating-help {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Custom Confirmation Modal */
.confirm-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.confirm-modal-content {
  background-color: #1a1a2e;
  border: 1px solid #2d2d44;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: all 0.3s ease;
}

.confirm-modal.active .confirm-modal-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.confirm-modal-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.confirm-modal-icon {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.confirm-modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.confirm-modal-body {
  padding: 2rem;
  text-align: center;
}

.confirm-modal-message {
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.confirm-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  min-width: 100px;
}

.confirm-btn-cancel {
  background: #6b7280;
  color: white;
}

.confirm-btn-cancel:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

.confirm-btn-confirm {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #0f0f23;
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.confirm-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

/* Load More Button */
.load-more-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin: 2rem 0 !important;
  padding: 0 1rem !important;
  text-align: center;
}

.load-more-btn {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #0f0f23;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 150px;
  margin: 0 auto;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-count {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* MY COLLECTION - STATIC GRID LAYOUT FOR MOBILE/TABLET */

/* Mobile Portrait (≤768px) - 2x3 grid, 6 items total */
@media (max-width: 768px) {
  /* MY COLLECTION - Static grid for perfect fit */
  #collection .collection-carousel {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100vh - 280px) !important;
    max-height: calc(100vh - 280px) !important;
    overflow: hidden !important;
  }
  #collection .carousel-container {
    height: 100% !important;
    overflow: hidden !important;
  }

  #collection .carousel-track {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }

  /* Hide navigation and pagination for My Collection */
  #collection .carousel-btn,
  #collection .pagination-info {
    display: none !important;
  }

  /* Show only first 6 items (2x3 grid) */
  #collection .carousel-item:nth-child(n+7) {
    display: none !important;
  }

  /* Compact cards that fit exactly */
  #collection .content-card {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
  }

  #collection .content-poster {
    height: 60% !important;
    min-height: 100px !important;
    max-height: 120px !important;
  }

  #collection .content-info {
    padding: 0.4rem !important;
    height: 40% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  #collection .content-title {
    font-size: 0.75rem !important;
    line-height: 1.1 !important;
    margin-bottom: 0.2rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  #collection .content-year {
    font-size: 0.65rem !important;
    margin-bottom: 0.2rem !important;
  }

  #collection .content-badge {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.3rem !important;
    margin-bottom: 0.2rem !important;
  }

  /* Hide overview and rating to save space */
  #collection .content-overview,
  #collection .content-rating {
    display: none !important;
  }

  #collection .content-actions {
    margin-top: auto !important;
  }

  #collection .add-btn,
  #collection .rate-btn {
    padding: 0.25rem !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
  }

  /* Compact stats for mobile */
  .collection-stats {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
    height: 60px !important;
  }

  .stat-card {
    padding: 0.5rem !important;
    min-width: auto !important;
  }

  .stat-number {
    font-size: 1.2rem !important;
    margin-bottom: 0.2rem !important;
  }

  .stat-label {
    font-size: 0.7rem !important;
  }
}

/* Small Mobile (≤480px) - 2x2 grid, 4 items total */
@media (max-width: 480px) {
  #collection .carousel-track {
    grid-template-rows: repeat(2, 1fr) !important;
    height: calc(100vh - 260px) !important;
    max-height: calc(100vh - 260px) !important;
  }

  #collection .collection-carousel {
    height: calc(100vh - 260px) !important;
    max-height: calc(100vh - 260px) !important;
  }

  /* Show only first 4 items (2x2 grid) */
  #collection .carousel-item:nth-child(n+5) {
    display: none !important;
  }

  #collection .content-poster {
    min-height: 90px !important;
    max-height: 110px !important;
  }

  #collection .content-title {
    font-size: 0.7rem !important;
  }

  #collection .add-btn,
  #collection .rate-btn {
    font-size: 0.6rem !important;
    padding: 0.2rem !important;
  }

  /* Even more compact stats */
  .collection-stats {
    height: 50px !important;
  }

  .stat-number {
    font-size: 1rem !important;
  }

  .stat-label {
    font-size: 0.65rem !important;
  }
}

/* Tablet Portrait (769px - 1024px) - 3x3 grid, 9 items total */
@media (min-width: 769px) and (max-width: 1024px) {
  #collection .collection-carousel {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: calc(100vh - 320px) !important;
    max-height: calc(100vh - 320px) !important;
    overflow: hidden !important;
  }

  #collection .carousel-container {
    height: 100% !important;
    overflow: hidden !important;
  }

  #collection .carousel-track {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    transition: none !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }

  #collection .carousel-btn,
  #collection .pagination-info {
    display: none !important;
  }

  /* Show only first 9 items (3x3 grid) */
  #collection .carousel-item:nth-child(n+10) {
    display: none !important;
  }

  #collection .content-card {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  #collection .content-poster {
    height: 65% !important;
    min-height: 120px !important;
    max-height: 160px !important;
  }

  #collection .content-info {
    padding: 0.6rem !important;
    height: 35% !important;
    overflow: hidden !important;
  }

  #collection .content-title {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    -webkit-line-clamp: 2 !important;
  }

  #collection .content-year {
    font-size: 0.7rem !important;
  }

  #collection .content-badge {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.4rem !important;
  }

  #collection .content-overview {
    display: none !important;
  }

  #collection .content-rating {
    font-size: 0.75rem !important;
    margin-bottom: 0.3rem !important;
  }

  #collection .add-btn,
  #collection .rate-btn {
    padding: 0.35rem !important;
    font-size: 0.75rem !important;
  }

  /* Tablet stats */
  .collection-stats {
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
    height: 80px !important;
  }

  .stat-card {
    padding: 0.75rem !important;
  }

  .stat-number {
    font-size: 1.5rem !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
  }
}

/* DISCOVER SECTION - Keep normal carousel behavior on ALL devices */
#discover .collection-carousel {
  background: #1a1a2e !important;
  border: 1px solid #2d2d44 !important;
  padding: 2rem !important;
  margin-bottom: 2rem !important;
}

#discover .carousel-btn {
  display: flex !important;
}

#discover .pagination-info {
  display: block !important;
}

/* GENERAL MOBILE STYLES (≤768px) */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hide sidebar by default on mobile */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    z-index: 101;
  }

  /* Show sidebar when active */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Show mobile user section on mobile */
  .mobile-user-section {
    display: block;
  }

  /* Hide desktop user info on mobile */
  #userInfo {
    display: none !important;
  }

  /* Adjust main content for mobile */
  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 3.5rem;
    height: 100vh;
    overflow-y: auto;
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .section-header h1 {
    font-size: 1.8rem;
  }

  .content-type-toggle,
  .filter-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* DISCOVER section mobile adjustments */
  #discover .collection-carousel {
    padding: 1rem !important;
    margin: 0 0 1rem 0 !important;
  }

  #discover .carousel-track {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0 40px !important;
    min-height: 420px !important;
  }

  #discover .carousel-btn {
    width: 35px !important;
    height: 35px !important;
    font-size: 1.2rem !important;
  }

  #discover .carousel-prev {
    left: 5px !important;
  }

  #discover .carousel-next {
    right: 5px !important;
  }

  /* Content grid mobile layout for other sections */
  .content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Mobile content cards for non-collection sections */
  .content-card {
    max-width: 100%;
  }

  .content-poster {
    height: 250px;
  }

  .content-info {
    padding: 1rem;
  }

  .content-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .content-overview {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }

  /* Modal mobile adjustments */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    max-height: 85vh;
  }

  .modal-header {
    padding: 1rem 1.5rem;
  }

  .modal-header h3 {
    font-size: 1.3rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .content-preview {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .modal-poster {
    width: 100px;
    height: 150px;
    margin: 0 auto;
  }

  .star-rating {
    font-size: 1.8rem;
    gap: 0.2rem;
  }

  /* Search box mobile */
  .search-box input {
    padding: 0.875rem 2.5rem 0.875rem 2.5rem;
    font-size: 1rem;
  }

  .search-icon {
    left: 0.875rem;
  }

  .search-clear {
    right: 0.875rem;
  }

  /* Hide carousel navigation buttons and pagination for mobile */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #00d4aa;
  color: #0f0f23;
  border: none;
  width: 40px;        /* Change from 50px to 40px */
  height: 40px;       /* Change from 50px to 40px */
  border-radius: 50%;
  font-size: 1.2rem;  /* Change from 1.5rem to 1.2rem */
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

/* VERY SMALL MOBILE (≤480px) */
@media (max-width: 480px) {
  .sidebar {
    width: 260px;
  }

  .mobile-menu-toggle {
    top: 15px;
    right: 15px;
    padding: 8px;
    width: 40px;
    height: 40px;
  }

  .mobile-menu-toggle span {
    width: 18px;
  }

  .main-content {
    padding: 0.75rem;
    padding-top: 3rem;
  }

  .section-header h1 {
    font-size: 1.6rem;
  }

  /* DISCOVER section very small mobile */
  #discover .carousel-track {
    padding: 0 35px !important;
    gap: 0.75rem !important;
    min-height: 380px !important;
  }

  #discover .carousel-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 1rem !important;
  }

  #discover .carousel-prev {
    left: 2px !important;
  }

  #discover .carousel-next {
    right: 2px !important;
  }

  .content-poster {
    height: 220px;
  }

  .content-info {
    padding: 0.875rem;
  }

  .star-rating {
    font-size: 1.5rem;
    gap: 0.1rem;
  }

  .toggle-btn,
  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .modal-content {
    width: 98%;
    max-height: 90vh;
  }

  .confirm-modal-content {
    width: 95%;
  }

  .confirm-modal-header {
    padding: 1rem 1.5rem;
  }

  .confirm-modal-title {
    font-size: 1.1rem;
  }

  .confirm-modal-body {
    padding: 1.5rem;
  }

  .confirm-modal-actions {
    flex-direction: column;
  }

  .confirm-btn {
    width: 100%;
  }
}

/* TABLET STYLES (769px - 1024px) - General tablet fixes */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-content {
    width: calc(100vw - 250px);
    max-width: calc(100vw - 250px);
    overflow-x: hidden;
  }

  /* DISCOVER section tablet */
  #discover .collection-carousel {
    padding: 1.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #discover .carousel-track {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding: 0 60px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 450px !important;
  }

  #discover .carousel-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.4rem !important;
    display: flex !important;
  }

  #discover .carousel-prev {
    left: 8px !important;
  }

  #discover .carousel-next {
    right: 8px !important;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
  }
}

/* DESKTOP STYLES - Ensure normal behavior */
@media (min-width: 1025px) {
  /* DISCOVER section maintains normal carousel behavior on desktop */
  #discover .carousel-btn {
    display: flex !important;
  }

  #discover .pagination-info {
    display: block !important;
  }

  /* MY COLLECTION keeps normal behavior on desktop */
  #collection .carousel-btn {
    display: flex !important;
  }

  #collection .pagination-info {
    display: block !important;
  }

  #collection .collection-carousel {
    background: #1a1a2e !important;
    border: 1px solid #2d2d44 !important;
    padding: 2rem !important;
  }
}

/* SMALL DESKTOP (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
  #discover .carousel-track,
  #collection .carousel-track {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* MEDIUM DESKTOP (1201px - 1400px) */
@media (min-width: 1201px) and (max-width: 1400px) {
  #discover .carousel-track,
  #collection .carousel-track {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* LARGE DESKTOP (>1400px) */
@media (min-width: 1401px) {
  #discover .carousel-track,
  #collection .carousel-track {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* Loading and transition states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background: #2d2d44;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
  background: #00d4aa;
}

/* Prevent any potential horizontal overflow */
html {
  overflow-x: hidden;
}

* {
  max-width: 100%;
}

/* Ensure images never cause overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Fix any flexbox issues */
.content-type-toggle,
.filter-controls {
  overflow: hidden;
}

/* Additional mobile touch improvements */
@media (max-width: 768px) {
  /* Improve touch targets */
  .carousel-btn {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .nav-item {
    min-height: 44px;
    touch-action: manipulation;
  }

  .toggle-btn,
  .filter-btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Prevent zoom on inputs */
  input {
    font-size: 16px;
  }

  /* Smooth scrolling */
  .main-content {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent content jumping during animations */
  .carousel-track {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

/* Show load more only on mobile for Discover */
@media (max-width: 768px) {
  #discover .load-more-container {
    display: flex !important;
  }
  
  #collection .load-more-container {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .load-more-container {
    display: flex !important;
  }
}

