/* ============================================
   SHARE FORM
   ============================================ */

.share-form-section {
  margin-bottom: 2rem;
}

.share-form-section form {
  display: block;
}

input[type="submit"].share-submit {
  width: 100%;
  justify-content: center;
  padding: 1rem 1rem;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #6c5ce7);
  box-shadow: 0 4px 20px var(--primary-glow);
  border-radius: var(--radius);
  transition: all 0.3s;
}

input[type="submit"].share-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(56, 214, 223, 0.4);
}

input[type="submit"].share-submit:disabled {
  color: #fff;
  filter: blur(4px);
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}

.share-submit-wrapper {
  position: relative;
  margin-top: 1rem;
}

.share-submit-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-light);
  z-index: 1;
  pointer-events: none;
}

.share-submit-hint[hidden] {
  display: none;
}

/* ============================================
   DROP ZONE
   ============================================ */

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-light);
  margin: 1rem 0;
  transition: all 0.3s;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

.drop-zone:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #e8feff 0%, #fff 100%);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.drop-zone svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  text-align: center;
  gap: 0.25rem;
}

.drop-zone-compact {
  padding: 1rem 2rem;
}

.drop-zone-compact .drop-zone-prompt {
  flex-direction: row;
  gap: 0.5rem;
}

.drop-zone-compact svg {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   FILE LIST
   ============================================ */

.file-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.file-list-wrapper[hidden] {
  display: none;
}

.empty-state .file-list-wrapper {
  max-height: none;
  flex: 1 1 0;
  min-height: 5rem;
}

.file-list-wrapper::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

.file-list-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.file-list-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.file-list-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.file-list-wrapper::-webkit-scrollbar-button {
  display: none;
}

.file-entry {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s;
  flex-shrink: 0;
}

/* The card itself acts as the progress bar via a ::before fill */
.file-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--progress, 0%);
  background: rgba(56, 214, 223, 0.1);
  transition: width 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

/* Shimmer on the progress fill while uploading */
.file-entry.uploading::before {
  background:
    linear-gradient(90deg, transparent, rgba(56, 214, 223, 0.15), transparent) no-repeat,
    rgba(56, 214, 223, 0.08);
  background-size: 40% 100%, 100% 100%;
  animation: entry-shimmer 2s linear infinite;
}

@keyframes entry-shimmer {
  0%   { background-position: -40% 0, 0 0; }
  60%  { background-position: 140% 0, 0 0; }
  100% { background-position: 140% 0, 0 0; }
}

/* Complete state: solid light green fill, green border */
.file-entry.complete {
  border-color: #a3d9b1;
}

.file-entry.complete::before {
  background: var(--success-light);
  animation: none;
}

/* Error state */
.file-entry.error {
  border-color: #f5c6cb;
}

.file-entry.error::before {
  background: var(--danger-light);
  animation: none;
}

.file-entry:hover {
  border-color: var(--primary-light);
}

.file-entry-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  z-index: 1;
}

.file-entry-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
}

.file-entry-icon svg {
  width: 20px;
  height: 20px;
}

.file-entry-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.file-entry-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-entry-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

.file-entry-remove {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-light);
  border-radius: 4px;
  transition: all 0.2s;
}

.file-entry-remove:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Spinner for uploads in progress */
.file-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-height: 0;
  padding: 2rem 1rem;
}

.empty-state-icon {
  filter: drop-shadow(0 6px 16px var(--primary-glow));
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.empty-state h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #6c5ce7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
}

.empty-state .share-form-section {
  width: 100%;
  max-width: 520px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  text-align: left;
}

.empty-state [data-tus-target="emptyStateHeader"] {
  text-align: center;
}
