/* ============================================================
   ALL UPLOADS VIEW STYLES
   ============================================================ */

.uploads-view-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #0f172a;
}

/* ============================================================
   REALTIME INDICATOR STYLES
   ============================================================ */

.realtime-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.realtime-indicator.connecting {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.realtime-indicator.connected {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.realtime-indicator.disconnected {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.realtime-indicator .indicator-text {
  white-space: nowrap;
}

/* Pulse dot for connected state */
.realtime-indicator .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* Small spinner for connecting state */
.realtime-indicator .spinner-small {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Wifi-off icon styling */
.realtime-indicator .icon-wifi-off {
  flex-shrink: 0;
}

.uploads-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative; /* Needed for drop overlay positioning */
}

/* Header */
.uploads-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  background-color: rgba(15, 23, 42, 0.5);
}

.uploads-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-count {
  font-size: 14px;
  color: #94a3b8;
}

.file-count span {
  font-weight: 600;
  color: #cbd5e1;
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background-color: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

/* Content */
.uploads-view-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Tile Grid */
.uploads-tile-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}

@media (min-width: 640px) {
  .uploads-tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .uploads-tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .uploads-tile-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Individual Tile */
.upload-tile {
  display: flex;
  gap: 12px;
  padding: 16px;
  background-color: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-tile:hover {
  background-color: rgba(30, 41, 59, 0.8);
  border-color: rgba(6, 182, 212, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upload-tile.tile-new {
  animation: tileFlash 2s ease-out;
}

@keyframes tileFlash {
  0% {
    background-color: rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.5);
  }
  100% {
    background-color: rgba(30, 41, 59, 0.5);
    border-color: rgba(51, 65, 85, 0.5);
  }
}

/* Tile Icon */
.tile-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-color: rgba(51, 65, 85, 0.5);
}

.tile-icon.image {
  color: #a78bfa;
}

.tile-icon.document {
  color: #60a5fa;
}

.tile-icon.unknown {
  color: #94a3b8;
}

/* Tile Content */
.tile-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile-filename {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-path {
  margin: 0;
  font-size: 12px;
  font-family: 'Monaco', 'Menlo', monospace;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-summary {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-summary.processing {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
  font-style: italic;
}

.processing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #fbbf24;
  animation: processingPulse 1.5s infinite;
}

@keyframes processingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tile Footer */
.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Uploader Badge */
.uploader-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}

.uploader-badge.uploader-officer {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.uploader-badge.uploader-caller {
  background-color: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.tile-timestamp {
  font-size: 11px;
  color: #64748b;
}

/* Empty State */
.uploads-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.uploads-empty .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  border-radius: 50%;
  background-color: rgba(51, 65, 85, 0.5);
  color: #475569;
}

.uploads-empty h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 500;
  color: #cbd5e1;
}

.uploads-empty p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  max-width: 300px;
}

/* Loading State */
.uploads-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.uploads-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.uploads-loading p {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
}

/* Error State */
.uploads-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.uploads-error .error-message {
  margin: 0 0 16px 0;
  padding: 16px;
  border-radius: 8px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 14px;
  text-align: center;
  max-width: 400px;
}

.uploads-error .retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.uploads-error .retry-btn:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

/* ============================================================
   DRAG AND DROP STYLES
   ============================================================ */

/* Drag over state for the uploads view */
/* Note: position: relative is set on base .uploads-view for overlay positioning */

.uploads-view.drag-over::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(6, 182, 212, 0.5);
  border-radius: 8px;
  background-color: rgba(6, 182, 212, 0.05);
  pointer-events: none;
  z-index: 10;
}

/* Drop overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.9);
  border: 2px dashed #06b6d4;
  border-radius: 8px;
  z-index: 100;
  pointer-events: none;
  animation: dropOverlayFadeIn 0.2s ease-out;
}

@keyframes dropOverlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drop-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.drop-overlay .drop-icon {
  color: #06b6d4;
  margin-bottom: 16px;
  animation: dropIconBounce 1s ease-in-out infinite;
}

@keyframes dropIconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.drop-overlay .drop-text {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
}

.drop-overlay .drop-subtext {
  margin: 0;
  font-size: 14px;
  color: #94a3b8;
}
