
/* ============================================================
   CSS Custom Properties — White-Label Brand Variables
   Override these per-organization via organization.js
   ============================================================ */
:root {
  /* Primary brand color (#4361ee default) — override per org via organization.js */
  --primary-color: #4361ee;
  --primary-hover: #3651d4;
  --primary-dark: #2d46b9;
  --primary-light: #e6effd;
  --primary-rgb: 67, 97, 238;

  /* Secondary / danger */
  --secondary-color: #e74c3c;
  --secondary-hover: #c0392b;

  /* Typography */
  --text-color: #333333;
  --text-muted: #666666;
  --text-light: #999999;
  --font-family: 'Poppins', sans-serif;

  /* Backgrounds */
  --bg-color: #f5f8fa;
  --bg-surface: #f8f9fa;
  --card-bg: #ffffff;

  /* Borders */
  --border-color: #dee2e6;
  --border-light: #eeeeee;
  --border-input: #dddddd;

  /* Navigation */
  --header-bg: #ffffff;
  --nav-link-color: #333333;
  --nav-active-color: var(--primary-color);

  /* Footer */
  --footer-bg: #f8f9fa;
  --footer-border: #dee2e6;
  --footer-text: #666666;
  --footer-link: var(--primary-color);

  /* Status / semantic (not changed by org branding) */
  --success-color: #28a745;
  --success-hover: #1e7e34;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --info-color: #3498db;
}

/* Update existing color references to use variables */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Folder selector styles */
.folder-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.folder-selector h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.folder-selector label {
  font-weight: 500;
  margin: 0;
}

.folder-selector select {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 200px;
  max-width: 300px;
}

/* Subfolder styling in upload dropdown */
.folder-selector select option[style*="italic"] {
  background-color: #f8f9fa;
  padding-left: 20px;
}

.folder-selector select option[style*="bold"] {
  background-color: #fff;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

/* Enhanced subfolder visual hierarchy */
.folder-selector select option {
  padding: 4px 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: #f5f8fa;
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}


.container {
  /* max-width: 800px; */
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

.main-content {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

header {
  text-align: center;
  margin-bottom: 0rem;
}

header h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #666;
  font-size: 1.1rem;
}

.upload-container {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: 1.7rem 2rem;
  margin-bottom: 2rem;
}

.upload-area {
  border: 2px dashed var(--primary-color);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 1rem;
}

.upload-area:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

.upload-area.active {
  background-color: rgba(67, 97, 238, 0.1);
  border-color: var(--primary-hover);
}

.upload-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.upload-area p {
  color: #666;
}

.upload-area span {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.file-list {
  margin: 1.5rem 0;
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-gap: 15px;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  align-items: center;
  transition: all 0.3s ease;
}

.file-item.completed {
  border-left: 4px solid #4CAF50;
  background-color: #f5fff8;
}

.file-item.failed {
  border-left: 4px solid #ff4757;
  background-color: #fff5f5;
}

.file-item.uploading {
  border-left: 4px solid var(--primary-color);
  background-color: #f0f7ff;
}

/* Style for invalid files */
.file-item.invalid {
  border-left: 4px solid #ff4757;
  background-color: #fff5f5;
  position: relative;
}

.file-item.invalid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 71, 87, 0.05);
  pointer-events: none;
  z-index: 1;
}

.file-item.invalid .file-preview {
  opacity: 0.7;
}

.file-preview {
  position: relative;
  width: 120px;
  height: 120px;
  background-color: #eaecef;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0; /* Remove bottom margin */
  grid-row: span 3; /* Make it span all rows */
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  color: var(--primary-color);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.play-overlay:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.file-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  grid-column: 2;
}

/* Update file-item layout for better responsive design */

/* Default desktop grid layout */
.file-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  grid-gap: 15px;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  align-items: center;
  transition: all 0.3s ease;
}

.file-preview {
  position: relative;
  width: 120px;
  height: 120px;
  background-color: #eaecef;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0; /* Remove bottom margin */
  grid-row: span 3; /* Make it span all rows */
}

.file-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  grid-column: 2;
}

/* Enhanced responsive styles for mobile */
@media (max-width: 576px) {
  .file-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
  }
  
  .file-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    margin-bottom: 12px;
    grid-row: auto;
    max-height: 180px;
  }
  
  .file-content {
    width: 100%;
    grid-column: auto;
  }
  
  .file-name {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .progress-container {
    height: 8px;
    margin-top: 8px;
  }
  
  /* Optimize meta information display for mobile */
  .file-meta {
    flex-wrap: wrap;
    gap: 5px;
  }
  
  /* Make selection header stack on mobile */
  .selection-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .selection-header .file-counter {
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
  }
  
  .selection-header .remove-all-button {
    width: 100%;
    justify-content: center;
  }
  
  /* Make the add more button full width */
  .add-more-button {
    width: 100%;
  }
  
  /* Improve error message display */
  .file-error {
    width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed #ffcccc;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .footer-links {
    margin-top: 1rem;
    justify-content: center;
  }

}

/* Very small screens optimization */
@media (max-width: 360px) {
  .file-item {
    padding: 10px;
  }
  
  .file-preview {
    max-height: 150px;
  }
  
  .file-name {
    font-size: 0.9rem;
  }
  
  .file-meta {
    font-size: 0.75rem;
  }

  footer {
    padding: 0px 0; /* Increase padding on mobile */
  }
  .footer {
    padding: 0px 0; /* Increase padding on mobile */
    margin-top: 20px;
    
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .footer-links {
    margin-top: 1rem;
    justify-content: center;
  }
}

/* Make sure the preview image fits properly */
.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Add a specific class for video thumbnails */
@media (max-width: 576px) {
  .preview-video {
    width: 100%;
    height: auto;
  }
  
  .play-overlay {
    font-size: 1.5rem;
  }
  
  footer {
    padding: 1.5rem 0;
  }
  .footer {
    padding: 0px 0; /* Increase padding on mobile */
    margin-top: 20px;
    
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {

  /* Fix upload folder selector width on mobile */
  .folder-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  
  .folder-selector select {
    min-width: unset;
    max-width: unset;
    width: 100%;
    box-sizing: border-box;
  }

  .container {
    max-width: 768px;
    margin: 0 auto;
    flex: 1;
    padding: 0.5rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .footer-links {
    display: grid;
    margin-top: 1rem;
    justify-content: center;
  }
}

/* Improve the visual appearance of the file name and buttons on mobile */
@media (max-width: 576px) {

  /* Optimize upload folder selector for small phones */
  .folder-selector {
    padding: 0.5rem;
    margin: 0.5rem 0;
  }
  
  .folder-selector select {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .container {
    margin: 0 auto;
    flex: 1;
    padding: 0.5rem;
  }


  .file-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 8px;
  }
  
  .remove-file {
    padding: 5px;
  }
  
}

.file-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 500;
}

.file-name .remove-file {
  color: #ff4757;
  cursor: pointer;
  font-size: 1rem;
}

.file-meta {
  display: flex;
  justify-content: flex-start;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 12px;
}

.file-meta .error {
  color: #ff4757;
  font-weight: 500;
}

.file-error {
  color: #ff4757;
  font-size: 0.8rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
}

.file-error i {
  margin-right: 4px;
}

.file-size {
  margin-right: 0.75rem;
}

.file-type {
  color: var(--primary-color);
}

.progress-container {
  height: 10px;
  background-color: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  margin-top: auto;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  width: 0%;
  border-radius: 8px;
  transition: width 0.3s ease;
}

.info-section {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: #f0f7ff;
  border-radius: 8px;    
  column-gap: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.info-item i {
  margin-right: 0.5rem;
}

button {
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  flex-shrink: 0;
}

button:disabled {
  background-color: #a8b1ef;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

/* button i {
  margin-right: 0.5rem;
} */

.result {
  padding: 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
}

.result.success {
  background-color: #d4edda;
  color: #155724;
}

.result.error {
  background-color: #f8d7da;
  color: #721c24;
}

.result.info {
  background-color: #e3f2fd;
  color: #0d47a1;
}

/* Add a warning class for the result div */
.result.warning {
  background-color: #fff8e1;
  color: #ff8f00;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.result.warning i {
  margin-right: 0.5rem;
}

.result.warning small {
  margin-top: 5px;
  font-size: 0.8rem;
  opacity: 0.9;
}


.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.file-counter {
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  color: #555;
}

.file-counter i {
  margin-right: 8px;
  color: var(--primary-color);
}

.remove-all-button {
  background-color: #ffe5e5;
  color: #ff4757;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  width: auto;
}

.remove-all-button:hover {
  background-color: #ffcccc;
}

.remove-all-button i {
  margin-right: 5px;
}

.upload-counter {
  background-color: #e8f5e9;
  color: #2e7d32;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.upload-counter i {
  margin-right: 8px;
  color: #2e7d32;
}

.pulse {
  animation: pulse-animation 1s ease-in-out;
}

@keyframes pulse-animation {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

/* Add these styles to your existing CSS file */

.batch-info {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 500;
}

.batch-info i {
  margin-right: 8px;
}

.fallback-button {
  width: 100%;
  padding: 12px;
  background-color: #f0f7ff;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1rem;
  border: 2px dashed var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fallback-button:hover {
  background-color: rgba(67, 97, 238, 0.1);
  transform: translateY(-2px);
}

.fallback-button i {
  margin-right: 8px;
}

/* Hide the file input properly */
#fileInput {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.close-lightbox {
  position: absolute;
  top: -40px;
  right: -40px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 2px solid white;
  background-color: #000;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 10px 0;
  font-size: 16px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Add More button styling */
.add-more-button {
  background-color: #e0f7fa;
  color: #00838f;
  border: 1px dashed #00838f;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
}

.add-more-button:hover {
  background-color: #b2ebf2;
  transform: translateY(-1px);
}

.add-more-button i {
  margin-right: 8px;
}

/* Update file-counter styling */
.file-counter {
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  color: #555;
}

.file-counter i {
  margin-right: 8px;
  color: var(--primary-color);
}

/* Style the selection header to properly align the counter and button */
.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.remove-all-button {
  background-color: #ffe5e5;
  color: #ff4757;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  width: auto;
}

.remove-all-button:hover {
  background-color: #ffcccc;
}

.remove-all-button i {
  margin-right: 5px;
}

/* ─── Canonical Loader Component ────────────────────────────────────────── */
.picup-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted, #888);
  font-size: 0.9rem;
}

.picup-loader__ring {
  width: 44px;
  height: 44px;
  border: 4px solid var(--bg-secondary, #eee);
  border-top-color: var(--primary-color, #4361ee);
  border-radius: 50%;
  animation: picup-spin 0.85s linear infinite;
  flex-shrink: 0;
  will-change: transform;
}

@keyframes picup-spin {
  to { transform: rotate(360deg); }
}

.picup-loader--sm .picup-loader__ring { width: 28px; height: 28px; border-width: 3px; }
.picup-loader--lg .picup-loader__ring { width: 64px; height: 64px; border-width: 5px; }

.picup-loader--inline {
  flex-direction: row;
  padding: 1rem;
  gap: 0.5rem;
}