// ========================================
// 📁 PDF UPLOADER COMPONENT STYLES
// ========================================

.pdf-uploader {
  width: 100%;
  background: var(--background);
  border-radius: 12px;
  overflow: hidden;
}

// ========================================
// 📋 HEADER
// ========================================

.uploader-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid var(--divider);

  .uploader-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .uploader-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
  }
}

// ========================================
// 📤 UPLOAD AREA
// ========================================

.upload-area {
  margin: 24px;
  padding: 40px 24px;
  border: 2px dashed var(--divider);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--surface);

  &:hover,
  &.drag-over {
    border-color: var(--idt-primary-color);
    background: rgba(var(--idt-primary-rgb), 0.05);
    transform: translateY(-2px);
  }

  .upload-icon {
    margin-bottom: 16px;

    i {
      font-size: 48px;
      color: var(--idt-primary-color);
      opacity: 0.7;
    }
  }

  .upload-content {
    .upload-text {
      margin: 0 0 8px 0;
      font-size: 18px;
      font-weight: 600;
      color: var(--text-primary);
    }

    .upload-support {
      margin: 0 0 24px 0;
      font-size: 14px;
      color: var(--text-secondary);
    }
  }

  .upload-button {
    display: inline-block;
    background: var(--idt-primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;

    &:hover {
      background: var(--idt-primary-shade);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(var(--idt-primary-rgb), 0.3);
    }

    input {
      display: none;
    }
  }
}

// ========================================
// 📄 DOCUMENTS SECTION
// ========================================

.documents-section {
  margin: 0 24px 24px 24px;

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--divider);

    h4 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: var(--text-primary);
    }

    .clear-all-btn {
      background: none;
      border: 1px solid var(--idt-danger);
      color: var(--idt-danger);
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 6px;

      &:hover {
        background: var(--idt-danger);
        color: white;
      }
    }
  }
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: grab;

  &:hover {
    border-color: var(--idt-primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  &.cdk-drag-preview {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    cursor: grabbing;
  }

  .document-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(var(--idt-danger-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;

    i {
      font-size: 20px;
      color: var(--idt-danger);
    }
  }

  .document-info {
    flex: 1;
    min-width: 0;

    .document-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .document-details {
      display: flex;
      gap: 12px;
      font-size: 12px;
      color: var(--text-secondary);

      .document-size {
        font-weight: 500;
      }
    }
  }

  .document-actions {
    display: flex;
    gap: 8px;
    margin-right: 12px;

    .action-btn {
      width: 32px;
      height: 32px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      font-size: 14px;

      &.view-btn {
        background: rgba(var(--idt-info-rgb), 0.1);
        color: var(--idt-info);

        &:hover {
          background: var(--idt-info);
          color: white;
        }
      }

      &.remove-btn {
        background: rgba(var(--idt-danger-rgb), 0.1);
        color: var(--idt-danger);

        &:hover {
          background: var(--idt-danger);
          color: white;
        }
      }
    }
  }

  .drag-handle {
    color: var(--text-secondary);
    cursor: grab;
    padding: 4px;

    &:hover {
      color: var(--text-primary);
    }

    i {
      font-size: 14px;
    }
  }
}

// ========================================
// ⏳ PENDING DOCUMENTS
// ========================================

.pending-documents {
  margin: 0 24px 24px 24px;

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--divider);

    h4 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: var(--text-primary);
    }

    .pending-count {
      font-size: 12px;
      color: var(--text-secondary);
      font-style: italic;
    }
  }
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pending-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 8px;
  transition: all 0.2s ease;

  &.required {
    border-left: 4px solid var(--idt-warning);
  }

  &.completed {
    border-left: 4px solid var(--idt-success);
    background: rgba(var(--idt-success-rgb), 0.05);
  }

  .pending-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;

    i {
      font-size: 18px;

      &.fa-exclamation-triangle {
        color: var(--idt-warning);
      }

      &.fa-check-circle {
        color: var(--idt-success);
      }

      &.fa-file-alt {
        color: var(--text-secondary);
      }
    }
  }

  .pending-info {
    flex: 1;
    min-width: 0;

    .pending-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
    }

    .pending-description {
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.4;
    }
  }

  .pending-actions {
    display: flex;
    align-items: center;
    gap: 12px;

    .status-badge {
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;

      &.pending {
        background: rgba(var(--idt-warning-rgb), 0.1);
        color: var(--idt-warning);
      }

      &.uploaded {
        background: rgba(var(--idt-success-rgb), 0.1);
        color: var(--idt-success);
      }
    }

    .send-btn {
      background: var(--idt-primary-color);
      color: white;
      border: none;
      padding: 6px 12px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;

      &:hover {
        background: var(--idt-primary-shade);
      }
    }
  }
}

// ========================================
// 🚫 EMPTY STATE
// ========================================

.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);

  i {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.3;
  }

  h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
  }

  p {
    margin: 0;
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
  }
}

// ========================================
// 📱 RESPONSIVE DESIGN
// ========================================

@media (max-width: 768px) {
  .pdf-uploader {
    .uploader-header {
      padding: 16px;
    }

    .upload-area {
      margin: 16px;
      padding: 24px 16px;

      .upload-icon i {
        font-size: 36px;
      }

      .upload-content .upload-text {
        font-size: 16px;
      }
    }

    .documents-section,
    .pending-documents {
      margin: 0 16px 16px 16px;
    }

    .document-item,
    .pending-item {
      padding: 12px;

      .document-info .document-name,
      .pending-info .pending-name {
        font-size: 13px;
      }

      .document-details,
      .pending-description {
        font-size: 11px;
      }
    }

    .section-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;

      .clear-all-btn,
      .pending-count {
        font-size: 11px;
      }
    }
  }
}

// ========================================
// 🌙 DARK MODE ADJUSTMENTS
// ========================================

@media (prefers-color-scheme: dark) {
  .upload-area {
    &:hover,
    &.drag-over {
      background: rgba(var(--idt-primary-rgb), 0.1);
    }
  }

  .document-item {
    &:hover {
      box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
  }
}
