/* BerryViral App - Main App Styles */
.filename-wrap {
  max-width: 25ch;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

:root {
  --bv-black: #111827;
  --bv-russian-violet: #1f2937;
  --bv-federal-blue: #374151;
  --bv-violet: #7e07edff;
  --bv-mint: #10b981;
}

body {
  background: #111827;
  color: #fff;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Modern gray color palette */
.bg-gray-900 { background-color: #111827; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-750 { background-color: #374151; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-400 { background-color: #9ca3af; }
.bg-gray-300 { background-color: #d1d5db; }

.text-gray-900 { color: #111827; }
.text-gray-800 { color: #1f2937; }
.text-gray-700 { color: #374151; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-gray-400 { color: #9ca3af; }
.text-gray-300 { color: #d1d5db; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-100 { color: #f3f4f6; }

.border-gray-800 { border-color: #1f2937; }
.border-gray-700 { border-color: #374151; }
.border-gray-600 { border-color: #4b5563; }

.text-white { color: #ffffff; }
.text-blue-400 { color: #60a5fa; }
.text-blue-500 { color: #3b82f6; }
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }

.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-600 { background-color: #16a34a; }

.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-gray-600:hover { background-color: #4b5563; }
.hover\:text-white:hover { color: #ffffff; }

.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 200ms; }
.duration-200 { transition-duration: 200ms; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-t { border-top-width: 1px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex { display: flex; }
/* .flex-col { flex-direction: column; } */
/* .flex-row { flex-direction: row; } */
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-3 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.75rem; }
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }

.gap-6 { gap: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-48 { width: 12rem; }
.w-64 { width: 16rem; }
.w-full { width: 100%; }
.max-w-7xl { max-width: 80rem; }

.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }

.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.top-0 { top: 0px; }
.top-16 { top: 4rem; }
.right-0 { right: 0px; }
.bottom-0 { bottom: 0px; }
.left-0 { left: 0px; }

.z-10 { z-index: 10; }

.hidden { display: none; }
.block { display: block; }

.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.invisible { visibility: hidden; }
.visible { visibility: visible; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:flex { display: flex; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Layout styles - updated for Tailwind components */
#app-navbar {
  /* Navbar styling is now handled by Tailwind classes in the component */
  z-index: 100
}

#app-sidebar {
  /* Sidebar styling is now handled by Tailwind classes in the component */
}

#app-workspace {
  margin-left: 16rem; /* 64 * 0.25rem = 16rem for w-64 sidebar */
  margin-top: 4rem; /* 4rem = h-16 navbar height for fixed positioning */
  padding: 2rem 1.5rem 2.5rem 1.5rem;
  background: #111827;
  min-height: calc(100vh - 4rem); /* 4rem = h-16 navbar */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

#app-footer {
  background: #1f2937;
  color: #fff;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  margin-top: auto;
}

@media (max-width: 768px) {
  #app-workspace {
    margin-left: 0;
    margin-top: 4rem; /* Keep top margin for fixed navbar */
    padding: 1rem 0.5rem 2.5rem 0.5rem;
  }
}

@media (max-width: 640px) {
  #app-workspace {
    margin-left: 0;
    margin-top: 4rem; /* Keep top margin for fixed navbar */
    padding: 0.5rem 0.25rem 2.5rem 0.25rem;
  }
}

/* Utility classes for BerryViral color scheme */
.bv-primary { color: var(--bv-violet); }
.bv-secondary { color: var(--bv-mint); }
.bv-bg-primary { background: var(--bv-violet); }
.bv-bg-secondary { background: var(--bv-mint); }
.bv-bg-surface { background: var(--bv-russian-violet); }
.bv-bg-elevated { background: var(--bv-federal-blue); }

/* === Sleek Panel/Card Styling === */
.sleek-panel {
  border: 2px solid var(--bv-violet);
  border-radius: 16px;
  background: var(--bv-black);
  transition: border-color 0.3s ease;
}

.sleek-panel-mint {
  border-color: var(--bv-mint);
}

.sleek-panel:hover {
  border-color: rgba(126, 7, 237, 0.8);
}

.sleek-panel-mint:hover {
  border-color: rgba(14, 185, 130, 0.8);
}

/* === Accordion Styling === */
.accordion-item {
  background: transparent;
  border-radius: 12px;
  border-top: 2px solid var(--bv-violet);
  border-left: 1px solid rgba(126, 7, 237, 0.3);
  border-right: 1px solid rgba(126, 7, 237, 0.3);
  border-bottom: none;
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(
    90deg,
    rgba(126, 7, 237, 0.02) 0%,
    rgba(126, 7, 237, 0.01) 20%,
    transparent 50%,
    rgba(126, 7, 237, 0.01) 80%,
    rgba(126, 7, 237, 0.02) 100%
  );
}

.accordion-header:hover {
  background: linear-gradient(
    90deg,
    rgba(126, 7, 237, 0.05) 0%,
    rgba(126, 7, 237, 0.03) 20%,
    rgba(126, 7, 237, 0.01) 50%,
    rgba(126, 7, 237, 0.03) 80%,
    rgba(126, 7, 237, 0.05) 100%
  );
}

.accordion-content {
  border-top: 1px solid rgba(126, 7, 237, 0.2);
  background: rgba(126, 7, 237, 0.01);
}

/* === File Drop Zone Styling === */
.file-drop-zone {
  background: transparent;
  border-radius: 12px;
  border-top: 2px solid var(--bv-mint);
  border-left: 1px solid rgba(14, 185, 130, 0.3);
  border-right: 1px solid rgba(14, 185, 130, 0.3);
  border-bottom: none;
  position: relative;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.file-drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(14, 185, 130, 0.02) 0%,
    rgba(14, 185, 130, 0.01) 20%,
    transparent 50%,
    rgba(14, 185, 130, 0.01) 80%,
    rgba(14, 185, 130, 0.02) 100%
  );
  pointer-events: none;
  z-index: -1;
}

.file-drop-zone:hover {
  border-top-color: rgba(14, 185, 130, 0.8);
  border-left-color: rgba(14, 185, 130, 0.5);
  border-right-color: rgba(14, 185, 130, 0.5);
  transform: translateY(-2px);
}

/* === URL Input Zone Styling === */
.url-input-zone {
  background: transparent;
  border-radius: 12px;
  border-top: 2px solid var(--bv-violet);
  border-left: 1px solid rgba(126, 7, 237, 0.3);
  border-right: 1px solid rgba(126, 7, 237, 0.3);
  border-bottom: none;
  position: relative;
  padding: 2rem;
  text-align: center;
}

.url-input-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(126, 7, 237, 0.02) 0%,
    rgba(126, 7, 237, 0.01) 20%,
    transparent 50%,
    rgba(126, 7, 237, 0.01) 80%,
    rgba(126, 7, 237, 0.02) 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* === Accessibility: Focus-visible for interactive elements === */
a:focus-visible, button:focus-visible, .sidebar-action-btn:focus-visible, .widget-action-btn:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(126,7,237,0.25); /* Violet focus ring */
  z-index: 2;
  position: relative;
  transition: box-shadow 0.18s;
}
.bv-bg-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(14,185,130,0.25); /* Mint focus ring for secondary */
}

/* === FOLDER MANAGEMENT STYLES === */

/* User review grid layout */
.user-review-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* User review cards */
.user-review-card {
  background: var(--bv-russian-violet);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.user-review-card:hover {
  border-color: var(--bv-violet);
  box-shadow: 0 8px 25px rgba(126, 7, 237, 0.15);
}

.user-review-card img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 10;
}

.user-review-card .review-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-review-card .review-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.user-review-card .score-text {
  background: var(--bv-violet);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Folder-specific styles */
.user-review-card .folder-indicator {
  position: absolute;
  /* top: 0.75rem; */
  right: 1rem;
  background: white;
  color: var(--bv-black);
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 11;
  box-shadow: 0 0 16px var(--bv-black)
}

.user-review-card:hover .folder-indicator {
  color: var(--bv-violet);
}

.user-review-card .folder-cover-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  height: 128px;
  /* background: linear-gradient(45deg, rgba(126, 7, 237, 0.1), rgba(14, 185, 130, 0.1)); */
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}

/* Folder hover animation - stacked thumbnail effect */
.user-review-card[data-folder-id],
.user-review-card.video-project-stack {
  position: relative;
}

.user-review-card[data-folder-id]::before,
.user-review-card[data-folder-id]::after,
.user-review-card.video-project-stack::before,
.user-review-card.video-project-stack::after {
  content: '';
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  height: 128px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s ease;
}

.user-review-card[data-folder-id]::before,
.user-review-card.video-project-stack::before {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* transform: translate(3px, -3px); */
  z-index: 2;

}

.user-review-card[data-folder-id]::after,
.user-review-card.video-project-stack::after {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* transform: translate(6px, -6px); */
  z-index: 1;

}

.user-review-card[data-folder-id]:hover::before,
.user-review-card.video-project-stack:hover::before { /* Immediately behind the main image*/
  opacity: 1;
  /* transform: translate(2px, -2px); */
  transition: transform 0.3s ease;
}

.user-review-card[data-folder-id]:hover::after,
.user-review-card.video-project-stack:hover::after {  /* Furthest back */
  opacity: 1;
  transform: translate(8px, -8px);
  transition: transform 0.3s ease;
}

.user-review-card[data-folder-id]:hover>img,
.user-review-card.video-project-stack:hover>img{ /* main image */
  transform: translate(-8px, 8px);
  transition: transform 0.3s ease;
}

/* Enhance the main folder overlay on hover */
/* .user-review-card[data-folder-id]:hover .folder-cover-overlay {
  background: linear-gradient(45deg, rgba(126, 7, 237, 0.15), rgba(14, 185, 130, 0.15));
  transform: translate(-1px, 1px);
} */


/* Drag and drop styles */
.folder-card {
  position: relative;
}

.folder-card.dragging {
  opacity: 0.6;
  transform: rotate(5deg) scale(0.95);
  z-index: 1000;
  border-color: var(--bv-violet);
}

.folder-card.drag-over {
  border-color: var(--bv-mint);
  background: rgba(14, 185, 130, 0.05);
  transform: scale(1.02);
}

.drop-zone-enhanced {
  position: relative;
  border-style: dashed !important;
  border-width: 3px !important;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--bv-mint);
    box-shadow: 0 0 0 0 rgba(14, 185, 130, 0.4);
  }
  50% {
    border-color: rgba(14, 185, 130, 0.7);
    box-shadow: 0 0 0 8px rgba(14, 185, 130, 0.1);
  }
}

.drag-instruction-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  color: var(--bv-black);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Folder expanded view */
.folder-expanded-container {
  grid-column: 1 / -1;
  background: var(--bv-russian-violet);
  border: 2px solid var(--bv-violet);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.folder-expanded-container h3 {
  color: var(--bv-violet);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.folder-expanded-container .user-review-list {
  margin-top: 1rem;
}

/* Pagination controls */
#userReviewPaginationControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bv-russian-violet);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

#userReviewPaginationControls button {
  background: var(--bv-violet);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#userReviewPaginationControls button:hover:not(:disabled) {
  background: #6b06c7;
  transform: translateY(-1px);
}

#userReviewPaginationControls button:disabled {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
}

#userReviewPageInfo {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Loading states */
.loading-circle {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .user-review-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .user-review-card {
    padding: 0.75rem;
  }
  
  .user-review-card img {
    height: 120px;
  }
  
  #userReviewPaginationControls {
    flex-direction: column;
    gap: 1rem;
  }
  
  #userReviewPaginationControls button {
    width: 100%;
    min-width: auto;
  }
  
  .folder-expanded-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .user-review-list {
    grid-template-columns: 1fr;
  }
  
  .user-review-card img {
    height: 100px;
  }
}

/* Grouping suggestions */
.grouping-suggestions {
  background: var(--bv-russian-violet);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.suggestion-group {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 0.5rem 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-group:hover {
  border-color: var(--bv-violet);
  background: rgba(126, 7, 237, 0.05);
}

.suggestion-group strong {
  color: var(--bv-violet);
}

.suggestion-group small {
  color: var(--text-tertiary);
  display: block;
  margin-top: 0.25rem;
}

/* === TRACKBAR STYLES === */
.trackbar-container {
  margin-top: 20px;
}

.trackbar {
  width: 100%;
  height: 5px;
  /* background: linear-gradient(90deg, #10b981 0%, #7e07edff 50%, #6b06c7 100%); */
  background: linear-gradient(90deg, var(--bv-federal-blue) 0%, var(--bv-mint) 100%);
  border-radius: 10px;
  /* overflow: hidden; */
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trackbar-indicator {
  position: absolute;
  top: 0;
  height: 100%;
  width: 5px;
  transform: scaleY(250%);
  background-color: #fff;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.trackbar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}